grep exclude
Hi,
I have man the pages for grep but couldn't find anything about exclude text. I use 'grep searchtext filename' to get the result of searchtext. However, I do not know how to exclude certain text from this search. Can grep do this? Thanks. |
You make an inverse grep: grep -v text_to_avoid.
|
** SOLVED **
Thank you..
ah ha, inverse=reverse=exclude. |
grep exclude command
I am new to Linux,
Anybody knows how to use grep to exclude 3 and 5 letters words from a file which have each word on its own line! To mention the words can be on extended lenght of letter size (words of 2,3,4,5,6,7, etc letters, one word per line. Use the 2 greps on the same command: the first to exclude 3 letter words, follow by the second to exclude 5 letter words Please advice if you can help me to solve this puzzle Thanks |
egrep -v '3|5'.
|
All times are GMT -5. The time now is 10:25 PM. |