LoginSignup
6
4

More than 5 years have passed since last update.

正規表現に一致しない行を調べる grep -v

Last updated at Posted at 2015-12-17

あるパターンに一致しない結果がほしい場合、複雑な正規表現を書くことになるが、 grep コマンドは -v オプションをつけるだけで、パターンに一致しない行を返してくれる。

grep -v PATTERN [FILE]

grep -v hoge foo.csv # hoge が含まれない行を foo.csv から返す
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4