特定の文字列を含むファイルを検索
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Linux全般]]
~
*パターン1 [#xa6582f4]
もっとも簡単なgrepを使用したコマンド。ディレクトリをスキ...
# grep 文字列 * -d skip
*パターン2 [#x1aa80ea]
# find /etc -type f -print | xargs grep 文字列
*パターン3 [#y91edde3]
findとgrepの組み合わせで特定の文字列を含むファイルを検索...
# find /var/www/ -name .htaccess |xargs grep 'memory'
/var/www/html/.htaccess:php_value memory_limit 256M
/var/www/html/admin/.htaccess:php_value memory_limit 1024M
/var/www/html01/.htaccess:#php_value memory_limit 64M
/var/www/html01/.htaccess:php_value memory_limit 256M
対象のファイル名条件を複数にするには -o(-orでも可)のオ...
# find . \( -name '*.php' -o -name '*.html' \) | xargs g...
~
~
終了行:
[[Linux全般]]
~
*パターン1 [#xa6582f4]
もっとも簡単なgrepを使用したコマンド。ディレクトリをスキ...
# grep 文字列 * -d skip
*パターン2 [#x1aa80ea]
# find /etc -type f -print | xargs grep 文字列
*パターン3 [#y91edde3]
findとgrepの組み合わせで特定の文字列を含むファイルを検索...
# find /var/www/ -name .htaccess |xargs grep 'memory'
/var/www/html/.htaccess:php_value memory_limit 256M
/var/www/html/admin/.htaccess:php_value memory_limit 1024M
/var/www/html01/.htaccess:#php_value memory_limit 64M
/var/www/html01/.htaccess:php_value memory_limit 256M
対象のファイル名条件を複数にするには -o(-orでも可)のオ...
# find . \( -name '*.php' -o -name '*.html' \) | xargs g...
~
~
ページ名: