General :: Grep - Output Show Only Right Of?
May 17, 2010
I forgot a lot of my command line. I am doing cat file | grep "error" and i would like it to show everything to the right of G:/ including G:/ if possible. I figure its an awk command but i dont know what. I tried awk '{print $8+}' but + does not work like i hoped and guessed.
View 2 Replies
ADVERTISEMENT
Mar 6, 2011
Following is my ifconfig output code...
I want to do some thing grep that I see the IP corresponding to each LAN card?
Is that possible?
View 8 Replies
View Related
Feb 15, 2011
I have a requirement to find the files having its name as ack_reply. However, there are many other files in the same directory as these resides. Now I have to remove these files from the folder and retain others after 7 days. So I tried to write the below script with grep command.
find $directory -type f -mtime +7 | grep ack_reply
how can I pass this output to -exec command.
If I am not using grep command my script would be as
find $directory -type f -mtime +7 -exec remove.sh {}\;;
How can I use -exec with grep and find.
View 4 Replies
View Related
Feb 5, 2010
I'm trying to grep the output of ngrep. Unfortunately when I add another grep to the pipeline, I get no output at all. It can be some other command too - cat / grep / tee - everything breaks the chain. Example:
[Code]....
If I use cat somefile instead of ngrep at the start, everything works as expected.
View 2 Replies
View Related
Aug 13, 2010
Is there some way to filter output of command by OR condition in Linux? There is filtering by AND condition with grep in way like:
ls -l | grep "^a" | grep "z$"
That says: list all files that beggins with "a" AND ends with "z" (so there is shorter way to write this: grep "^a.*z$", but it is not matter). Is there some way to perform test by OR condition? For example: files that starts exactly with "xen" OR files that ends exactly with ".rpm". But exactly, not something like:
grep "[xen]{0,3}.*[.rpm]{0,4}"
View 2 Replies
View Related
Aug 24, 2010
how I cat to filter out information about Unix Domain Sockets from netstat output without grep? Is there some option for command (I not found it in man of netstat).
View 2 Replies
View Related
Feb 21, 2010
In linux, I can grep a string from a file using grep mySearchString myFile.txt.
How can I only get the result which are unique?
View 1 Replies
View Related
Feb 3, 2010
I would like to grep two numbers out of a text file, and divide them.
Here is the script code...
It feels like grep saves a new line too? or what is happening? i simply can't divide them, as it handles the variables as they are empty (and prints the two numbers although they were not printed
View 6 Replies
View Related
Oct 31, 2010
This has to also show the line count. I can get it to show the files but not the line count. What is the single command used to identify only the matching count of all lines within files under the /etc directory that contain the word „HOST? List only the files with matches and suppress any error messages.
View 4 Replies
View Related
Mar 22, 2010
I have some big files of logs that contain errors printed by an app. They are most of the time relevant, however most of them are similar. So i figured i could check what happened between a time interval with a find.
Im using this one
Code:
And I get an output similar to this one.
Code:
Is there a way to condensate the output lines to get only one or two, indicating the start and last occurrence of a block? Or I need to create a program to do so?
Because right now I get thousands of similar lines, but when I'm scrolling through them i sometimes miss relevant information that i would've otherwise noted if it wasn't all that spammy.
View 10 Replies
View Related
Mar 30, 2011
Let's say I have a command
ls -Bgclt /somwhere/in/the/past
How do I limit the output to show me only first 2 files? (except for having only 2 files in that directory)
View 2 Replies
View Related
Jan 3, 2011
i have 10 vi files . these files contain some system related information. i need to combine the output of all these files into a single file. the final file should contain contents of all these 10 files and the output should be in a tabular format.
is there any command in vi that i can use to create a table ?
View 9 Replies
View Related
Feb 15, 2011
Is it possible to show the output of a command in xfce4-panel? Like you would do with Conky.The Xfce battery monitor consistently uses a bit of my CPU so I wish to run "acpi" (and work out a clever way to just show the percentage) every 5 or 10 minutes in the panel.
View 5 Replies
View Related
Jul 1, 2010
I am using:
user@unknown:~$ sudo command -option > log
to save the results of "command" to the file "log", but I'd like to also get the result on the terminal, is this possible?
I am using ubuntu 10.04 lts.
View 3 Replies
View Related
Apr 12, 2011
How can I make the Linux ping to show the requests 'time out' instead of omitting the output?
Just like the Windows version of ping.
View 3 Replies
View Related
Apr 7, 2009
I am trying to use a shell script to find a string in a file and do something when found. code...
What should happen is pppd will start in a different process and stream it's output to pppdout. pppdout should be created in the current folder. Then the script should periodically check the pppdout file for the string Script (which eventually will appear, some seconds later) and when found exit the script. Ultimately the script will do something useful when the text is found. However, the output from the program is a repeating: 'scriptname.sh: 12: FOUND: not found'
Where scriptname.sh would be the name of your script and 12 refers to the line with 'done'.
Why does grep not find the text, or at least why deos my script not check the grep output correctly?
View 10 Replies
View Related
Apr 14, 2010
How can I remove characters from grep output using sed? code...
View 9 Replies
View Related
Sep 1, 2010
So theres this command
Code:
man -k mail
Which lists commands that contain the keyword "mail" in their description.I want the output of this command in less and the words highlighted by grep. Something like
Code:
man -k mail | grep mail | less
The command doesn't work, how do I fix it?
View 2 Replies
View Related
Nov 11, 2010
I want to pipe the output of a command into grep as the search TERM, rather than the text to be searched, like this for example
Code:
cat /var/log/auth.log | grep date "&b &d"
so that I only see the lines in auth.log for the current day...but obviously that line doesn't work.... is there a way to do this with grep, or even another command?
View 4 Replies
View Related
Jul 13, 2011
I am not sure why this does not work..
tshark |grep 'string'
Gives me what I want but
tshark |grep 'string' >/tmp/outputfile
Gives me an empty file.
View 3 Replies
View Related
Jul 28, 2010
I have two files :
FileA
prot1
prot5
prot9
prot15
[Code]....
What I need to do is to extract from fileB the fields containing only the strings in fileA.
I thought awk could do the job easily with :
Code:
awk 'BEGIN { RS = "###" } /'$variable'/' fileB > output
where variable would maybe be the output of grep from fileA. So can I store the output of grep in a variable to use it afterwards with awk ?
something like that:
Code:
result=`grep prot. fileA` ; awk 'BEGIN { RS = "###" } /'$result'/' fileB > output
but that doesn't work. I'm always getting the entire fileB.
The output of grep get stored in the variable, I verified that with echo. So there is something that I just don't get... It seems to me that the above line should work.
View 11 Replies
View Related
Jan 21, 2011
Ive installed Ubuntu recently but none of my attempts to get the wifi network working were successfull. It establishes connection but the indicator shows no signal and I cant connect to any website, I tried pinging external IPs etc. None of these worked. lspci -nn | grep 'Wireless Brand'Does not show anything. I could find 03:00:0 Network Controller: Intel Corporation Ultimate N WiFi Link 5300 lsmod | grep "wlan_module_name"Doesnt show anything. Restarting network says only: *Reconfiguring network interfaces... Kernel boot messages:
[Code]....
The network Im trying to connect to is hidden, so I have to input SSID manually, I doubt this causes the problem.
View 2 Replies
View Related
May 1, 2011
My script.
This is may script:
Code:
Problem: Output file doest not exclude the values in grep -av
View 3 Replies
View Related
Mar 25, 2010
i am reading a database flat file with the "awk" command which has 4 fields separated by colon ":" .I want to show the output of these fields in a certain way that every record is numbered e.g
1.some text
2.some text
Is there a way to do this?
View 14 Replies
View Related
Nov 22, 2010
I need to kind of grep within grep. My input file would be something like:
[Code]....
and I need to find the first occurrence of hello before MY PATTERN (hello 9008 in this case), so the output should be:
[Code]....
View 4 Replies
View Related
Jan 7, 2010
it should be simple, but i don`t get it: if i search for stuff, i may pipe it to grep to "filter" it:
Code:
ls /usr/bin | grep ice
but how would i say grep not to show the ones containing "term"/"string" example would be with locate
Code:
locate fluxbox | -> but not the ones in /home
View 4 Replies
View Related
Apr 28, 2011
I configured it to use IMAP to access our exchange 2010 server front end on a LAN connection. Our webmail connection is segregated behind Forefront, so it was not connecting/authing that way. Even though smartphones have no problem. (sidenote, is there an activesync linux mail client ?)
I have many root folders and several folders underneath my inbox. total mailsize in inbox is 3.5 GB without subfolders. The sent is likewise as large. And is likewise empty.
Things I checked already:
View is all
Folder subscription is on and local copy is on
More info:
Thunderbird worky fine.
But thunderbird is missing calender
Tried adding lightening, but it won't add into thunderbird.
Will try finding a diff add on, or if anyone knows how to get lightening into thunderbird 3.1.8 on ubuntu 10 that would be great as well.
View 1 Replies
View Related
Nov 16, 2010
I need to show an output of the command "show interface status" executed on a server side in new window on client side. In other words: on client side web browser page I would like to have a link which I can click and get output of command "show interface ... status" in a new window. On web server script has to connect to switch/router, execute this command and send output to client window.
where to look, and, may be explain, what can be better for this purpose? I need a clue, because I have newer done it before. It should not be snmp, because I want to view many different outputs and snmp wont help me.
View 2 Replies
View Related
Oct 20, 2010
I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?
View 3 Replies
View Related
Apr 7, 2011
I need to find file from ls - l by using grep and certain regexp.
In particular I need greep to see certain file ending, like let's say .txt but only using regex.
So it should be something like
ls -l | grep '^.+.txt$'
But that doesn't seem to work for me.
View 1 Replies
View Related