salsa
salsa

Reputation: 61

how to find in text for a negative word?

How i find all lines not containing this word: "_archive" ???

XXXXXXXXXXXXXXXXXXXXXXXXX _archive 1
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 2
XXXXXXXXXXXXXXXXXXXXXXXXX teste 1
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 3
XXXXXXXXXXXXXXXXXXXXXXXXX teste 2
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 4
XXXXXXXXXXXXXXXXXXXXXXXXX teste 3
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 5
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 6
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 7
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 8
XXXXXXXXXXXXXXXXXXXXXXXXX teste 4
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 9
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 10
XXXXXXXXXXXXXXXXXXXXXXXXX _archive 11
XXXXXXXXXXXXXXXXXXXXXXXX teste 5

Thanks

Upvotes: 0

Views: 103

Answers (2)

chahuistle
chahuistle

Reputation: 2645

suppose your file is under "file.txt"

the following unix command would do it

grep -v _archive file.txt

Upvotes: 0

Greg Hewgill
Greg Hewgill

Reputation: 994211

Use grep -v:

grep -v _archive inputfile.txt

This command prints out each line in inputfile.txt that does not contain _archive.

Upvotes: 3

Related Questions