【grep】
| grep | |
|---|---|
| grep |
指定した文字列を抽出する。主にパイプ(|)の後ろに指定されて
利用される事が多い。 例)httpプロセスの稼動状況を調べる。 ps aux | grep http |
| grep -i [文字列] | 大文字と小文字を区別しない。 |
| grep -v [文字列] |
指定した文字列を含まない。 例)httpプロセスの稼動状況を調べるが、grepコマンド自体のプロセス を表示させない。 ps aux | grep http | grep -v grep |
| grep [文字列] [パス] |
指定したパスにあるファイルの中に、指定した文字列が含まれる行
を抽出する。 例)/etc配下のファイルの中に「http」という文字列が含まれる行を 抽出する。 grep http /etc |
| 関連コマンド | cat |