Unix-使用Grep获取不匹配的行

问题描述:

我是unix的新手.我想从文件1中复制不匹配的模式,前提是这些模式在文件2中.实际文件有1000行以上.

I am new to unix. I want to grep the unmatched pattern from a file1 provided that the patterns are in the file2. The real files are having more than 1000 lines.

示例:

File1:
Hi(Everyone)
How(u)people(are)doing?
ThanksInadvance

File2:
Hi(Every
ThanksI

必填结果:

How(u)people(are)doing?

我只希望使用grep的模式("Hi(Every").它应该从file1返回不匹配的行.

I want only the pattern to be used like ("Hi(Every") for the grep.It should return the unmatched line from file1.

此行适用于给定示例:

grep -Fvf file2 file1

上面使用的3个选项:

-F  makes grep do fixed-string match
-v  invert matching
-f  get patterns from file