LoginSignup
0
0

More than 3 years have passed since last update.

grep コマンドのよく使うオプションまとめ

Last updated at Posted at 2020-06-02

CentOS 7 で確認。grep のバージョンは GNU grep 2.20。

拡張正規表現を使用

-E

大文字小文字を区別しない

-i

ディレクトリ内のすべてのファイルを検索

-R

シンボリックリンクもたどる。

バイナリファイルは検索しない

-I

マッチした文字列のみを出力

-o

マッチしない行を出力

-v

行番号も出力

-n

前後の行も出力

-C <行数>
0
0
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
0
0