Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大きなファイルがあり、特定の望ましくないパターンに一致しない行を印刷したいと考えています。以下は、私が望むものとは正反対です。つまり、望ましくない行をすべて保持します。
grep -e '\[0.0, 0.0\]' locscore.txt
上記のパターンを持たない行を取得するにはどうすればよいですか? 私は試した
grep -e '^*(?!\[0.0, 0.0\])*$' locscore.txt
しかし、それは何も生み出しません。
grep を使用する場合、オプションがあり、-v必要なことを実行します。
-v
マンページから:
-v, --invert-match Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)