ファイルにどのパターンや単語がないかを知りたいです。例:
テスト.txt
marco
polo
charlie
anthony
john
egrep 'marco|polo' test.txt
marcoとpoloを出力します。
しかし、ファイルに単語がない場合は、その単語を出力するコマンドが必要です。
たとえば、egrep 'cindrella|daniel|polo' test.txt
ポロではなくcindrellaとdanielを出力する必要があります。
ベストアンサー1
grepingを逆にしたいです。
printf "%s\n" cindrella daniel polo | grep -v -f test.txt
cindrella
daniel
どこ
-v
逆のオプションです-f test.txt
入力リストのインポートtest.txt