0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

grepコマンド

Posted at

ついに昨日で途切れてしまった連続記録。。
続けることが大事だけど、それで止めるのはよくないので気を取り直して再スタート。

###grepコマンドとは
・ファイルの中で「文字列(パターン)」が含まれている行を表示するコマンド
・検索対象には、複数のファイルやディレクトリを指定できる
・ファイルを指定しなかった場合は、標準入力から読み込む
※パイプ(|)と組み合わせて、他のコマンドの出力結果から必要な箇所だけを絞り込んで表示する際によく使われる

###代表的なオプション
・-c:マッチした行数のみ表示
・-v:マッチしなかった行数のみ表示
・-n:先頭に行番号をつけてマッチした行を表示
・-f:検索パターンからファイルを読み込む
・-i:大文字と小文字を区別しない
・-E:egrepと同様(拡張正規表現)
・-F:fgrepと同様(検索パターンエオ固定文字列)

以上。

0
3
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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?