Grep command to fetch all the content except specified text

Here is the grep command to fetch all the content except the specified.

Syntax: cat <SRC File Name>| grep -v “<search string>”  >  <DEST File Name>

Ex: cat test.txt | grep  -v “string t o find” > test1.txt

This command will filters those lines which contains the specified text. Remaining will be copied to the output file.

Related article:

http://blog.theunical.com/linux/grep-command-to-fetch-all-the-content-only-specified-text/

Grep command to fetch all the content only specified text

Here is the grep command to fetch all the content except the specified.

Syntax: cat <SRC File Name>| grep “<search string>”  >  <DEST File Name>

Ex: cat test.txt | grep  -v “string t o find” > test1.txt

This command will filters those lines which contains the specified text. Remaining will be copied to the output file.

Related Post :

http://blog.theunical.com/linux/grep-command-to-fetch-all-the-content-except-specified-text/