find 命令“找到”我正在寻找的文件,但它不存在

find 命令“找到”我正在寻找的文件,但它不存在

我正在搜索特定文件,因此我使用该find命令,它找到了我正在查找的文件:

$ find / -name connect_power.aif 2>&1 | grep -v "Operation not permitted\|Permission denied\|No such file or directory"

/System/Library/CoreServices/PowerChime.app/Contents/Resources/connect_power.aif
/System/Volumes/Data/System/Library/CoreServices/PowerChime.app/Contents/Resources/connect_power.aif

运行ls -l /System/Volumes/Data/System/Library/CoreServices/PowerChime.app/Contents/Resources/connect_power.aif,我得到以下信息。

ls: /System/Volumes/Data/System/Library/CoreServices/PowerChime.app/Contents/Resources/connect_power.aif: No such file or directory

运行find / -name connect_power.aif -ls产量:

1152921500311980401      240 -rw-r--r--    1 root             wheel              159358 Feb 29 03:49 /System/Volumes/Data/System/Library/CoreServices/PowerChime.app/Contents/Resources/connect_power.aif

因此,根据输出,它在两个不同的位置找到了该文件。我可以到达第一个,但无法到达第二个。具体来说,当我到达PowerChime.app子目录时它“中断” - 它出错并说它不存在。那么,如何find找到它以及如何找到它?

根据记录,这是在 macOS Catalina (10.15.5) 上,但这不是一个以 Apple/Mac 为中心的问题,因为我也在 FreeBSD 中遇到过这个问题。

相关内容