LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   grep exclude (https://www.linuxquestions.org/questions/linux-general-1/grep-exclude-118411/)

Manuel-H 11-21-2003 12:17 AM

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.

Bebo 11-21-2003 04:12 AM

You make an inverse grep: grep -v text_to_avoid.

Manuel-H 11-21-2003 05:15 AM

** SOLVED **
 
Thank you..

ah ha, inverse=reverse=exclude.

ece 10-12-2010 07:36 PM

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

quanta 10-12-2010 08:50 PM

egrep -v '3|5'.


All times are GMT -5. The time now is 10:25 PM.