开发者

how to find in text for a negative word?

开发者 https://www.devze.com 2023-02-07 17:00 出处:网络
How i find all linesnot containing this word: \"_archive\" ??? XXXXXXXXXXXXXXXXXXXXXXXXX _archive 1 XXXXXXXXXXXXXXXXXXXXXXXXX _archive 2

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 _archi开发者_运维知识库ve 10

XXXXXXXXXXXXXXXXXXXXXXXXX _archive 11

XXXXXXXXXXXXXXXXXXXXXXXX teste 5

Thanks


Use grep -v:

grep -v _archive inputfile.txt

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


suppose your file is under "file.txt"

the following unix command would do it

grep -v _archive file.txt
0

精彩评论

暂无评论...
验证码 换一张
取 消