下面有一个/tmp名为的目录test_copy。
$ ls /tmp/test_copy/
a.sh b.sh
$ cd /tmp
/tmp$ find . -name test_copy
./test_copy
Run Code Online (Sandbox Code Playgroud)
但是,如果我运行以下find命令,它不会返回任何内容。
~/scripts$ find /tmp -name test_copy
~/scripts$
Run Code Online (Sandbox Code Playgroud)
为什么find在最后一种情况下找不到目录?
xhi*_*nne 15
如果/tmp是符号链接,find则不会进入目录,只会停止,什么也没找到。
另一方面,以下任何命令都可以使用:
find -H /tmp -name test_copy
find /tmp/ -name test_copy
Run Code Online (Sandbox Code Playgroud)
(结尾/取消引用符号链接)