以下の内容はhttps://takuya-1st.hatenablog.jp/entry/2018/05/01/124506より取得しました。


grep でシンボリック・リンクのファイルとディレクトリを無視する

grepすると終わらねぇ

遭遇した問題 。Grepでファイルを検索したら再帰的に無限ループになって検索が終わらない。

ディレクトリのリンクをたどってそれがまた次のディレクトリをたどって、永遠にループする。

シンボリック・リンクを無視する

どうすればいいか。ぐぐってみたら

grep -r を使う

これを書くことでリンクを辿らなくなる。マジカ

再帰的に検索。

man には書いてない。。。

       -R, -r, --recursive
              各ディレクトリの下にあるすべてのファイルを再帰的に読み込みます。 これは -d recurse オプションと等価です。

UbuntuLinux man-JP を読んでも書いてないんだけど.

GNU の最新版のman をんだら書いてあった

       -R, --dereference-recursive
              Read all files under each directory, recursively.  Follow all symbolic links, unlike -r.

       -r, --recursive
              Read all files under each directory, recursively, following symbolic links only if they are on
              the command line.  Note that if no file operand is given, grep searches the working directory.
              This is equivalent to the -d recurse option.

日本語man信用できない

参考資料

https://stackoverflow.com/questions/21738574/how-do-you-exclude-symlinks-in-a-grep




以上の内容はhttps://takuya-1st.hatenablog.jp/entry/2018/05/01/124506より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14