LoginSignup
1
1

More than 5 years have passed since last update.

grepの小ネタ

Posted at

CR+LFファイルを行末のパターンでマッチさせる

末尾が200で終わるものを抽出する例

$ grep '200\s*$' logfile

LFファイルなら単に200$でよかった。\sは制御文字を含めた空白。

検索結果に各ファイルのファイル名を含めないようにする

     -h, --no-filename
             Never print filename headers (i.e. filenames) with output lines.

1
1
2

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
1
1