< linuxtable_01_001.html < linkdetail01.htm < indextable01.htm < index.html

tack Developers Group Homepage!

<<< grep_01_001.html >>>


(KENT-WEB-San Dream Counter... 2024R06-0701-MON-1734)

※ Console command copy/paste - Ctrl+Shift+c/v

「複数ファイル」「コマンド」のどちらの検索ワードも含む行としたい場合:

※ ファイル名やディレクトリー名(フォルダー名)に空白がある場合はさらに工夫が必要です。Linuxコンソールでは空白を挟むのは基本的にはご法度です。

*.txtを対象に("*"はすべてのファイル名に該当。".txt"は拡張子指定)、「複数ファイル」「コマンド」の両方を満たすGrepをかけ、その結果をfindgrep_result_002.txtやgrepmulti_result_001.txtにコピーします。

(検索ワードは"| grep {文字列}"で増やします。"|"はパイプと呼びます)

・find . -name "*.txt" | xargs grep -n 複数ファイル | grep コマンド > findgrep_result_002.txt

・grep -n 複数ファイル *.txt | grep コマンド > grepmulti_result_001.txt

両者ともほぼ同じ動作をします。
(... 2024R06-0701-MON-1649)


(... 2024R06-0701-MON-1649)

CC BY tDG.