Grep コマンド
【testディレクトリ内のファイルすべての中からtestという文字を検索する】
grep 検索正規表現 ファイル名
grep test test/*
【testディレクトリ内のさらに下層のディレクトリ内のファイルすべての中からtestの文字を検索する】
grep –r 検索正規表現 ファイル名
grep -r test test/*
例
grep test /*
「/」配下のファイルからのみ、「test」の文字列がないか探す
grep test *
現在の「カレントディレクトリ」配下のファイルのみ、 「test」の文字列がないか探す
![](https://cyber-security-forensic.com/wp-content/uploads/2020/03/image.png)
![](https://cyber-security-forensic.com/wp-content/uploads/2020/03/image-1.png)
![](https://cyber-security-forensic.com/wp-content/uploads/2020/03/image-2.png)
コメント