最終更新:2023-04-13 (木) 07:11:04 (341d)
grep
Top / grep
文字列を検索する
grep [オプション] [パターン] [ファイル]
メモ
grep -r "Make Caps Lock" /usr/*
例
ps aux | grep httpd grep "hoge" *.txt
パラメータ
再帰
grep -r PATTERN target_directory
オプション
-i | --ignore-case |
-v | --invert-match |
マッチした前後を表示
-A num
- --after-context=num
- Print num lines of trailing context after matching lines.
-B num
- --before-context=num
- Print num lines of leading context before matching lines.
-C num
- -num
- --context=num
- Print num lines of leading and trailing output context.