find
コマンドが一部のファイルを見つけることができないが、別のファイルを見つけることができ、それらはすべてローカルパスに存在するという奇妙な状況が発生します。
スクリーンショットとしての元のコード:
ファイルはそこにあります:
$ ls -lh ~/.config/fish/functions/
total 92K
-rw-rw-r-- 1 echecod echecod 4.2K Dec 20 16:42 __async_prompt.fish
-rw-rw-r-- 1 echecod echecod 3.0K Dec 20 16:42 done.fish
-rw-rw-r-- 1 echecod echecod 597 Dec 20 16:42 humanize_duration.fish
-rwxrwxr-x 1 echecod echecod 5.2K Dec 20 16:42 __informative_git_prompt.fish*
-rwxrwxr-x 1 echecod echecod 1.4K Dec 20 16:42 prompt_pwd.fish*
-rw-rw-r-- 1 echecod echecod 61K Feb 20 11:38 z.lua
しかし、それらは見つかりません:
$ find ~/.config -name z.lua
$ find ~/.config -name prompt_pwd.fish
上位ディレクトリとその中のファイル:
$ ls -ld ~/.config/fish/
drwx------ 2 echecod echecod 4096 Feb 20 13:35 /home/echecod/.config/fish/
$ ls -lh ~/.config/fish/
total 24K
lrwxrwxrwx 1 echecod echecod 46 Dec 20 16:45 config.fish -> ../../Dotfiles.d/fish/.config/fish/config.fish*
-rw-r--r-- 1 echecod echecod 1.3K Dec 7 11:00 fishd.DUA-001
-rw-r--r-- 1 echecod echecod 14K Feb 19 18:21 fishd.DUA-BuildServer000
-rw-r--r-- 1 echecod echecod 2.7K Feb 19 10:47 fish_variables
lrwxrwxrwx 1 echecod echecod 44 Dec 20 16:45 functions -> ../../Dotfiles.d/fish/.config/fish/functions/
これらは見つけることができます:
$ find ~/.config -name config.fish
/home/echecod/.config/fish/config.fish
$ find ~/.config -name fish_variables
/home/echecod/.config/fish/fish_variables
$ find ~/.config -name functions
/home/echecod/.config/fish/functions
そして念のために(のでfunctions -> ../../Dotfiles.d/fish/.config/fish/functions/
):
$ ls -lh ~/Dotfiles.d/fish/.config/fish/functions/
total 92K
-rw-rw-r-- 1 echecod echecod 4.2K Dec 20 16:42 __async_prompt.fish
-rw-rw-r-- 1 echecod echecod 3.0K Dec 20 16:42 done.fish
-rw-rw-r-- 1 echecod echecod 597 Dec 20 16:42 humanize_duration.fish
-rwxrwxr-x 1 echecod echecod 5.2K Dec 20 16:42 __informative_git_prompt.fish*
-rwxrwxr-x 1 echecod echecod 1.4K Dec 20 16:42 prompt_pwd.fish*
-rw-rw-r-- 1 echecod echecod 61K Feb 20 11:38 z.lua
私の何が問題になっていfind
ますか?
ご参考までに:
/usr/bin/find
~/.config/fish/functions
シンボリックリンクです。したがって、それは[強調鉱山]についてです:
-P
シンボリックリンクをたどらないでください。これがデフォルトの動作です。find
ファイルの情報を調べたり印刷したりする場合、そのファイルがシンボリックリンクである場合、使用される情報はシンボリックリンク自体のプロパティから取得されるものとします。
-L
シンボリックリンクをたどります。find
ファイルに関する情報を調べたり印刷したりする場合、使用される情報は、リンク自体からではなく、リンクが指すファイルのプロパティから取得されるものとします[...]。が有効で、検索中にサブディレクトリへのシンボリックリンクを検出した場合、シンボリックリンクが指すサブディレクトリが検索され-L
find
ます。
を使用しfind -L
ます。これはオプションであり、オペランドではありません。パスの前に表示されます。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加