我在其中创建了一个目录d
和一个文件f
。然后我只给了自己对该目录的读取权限。我明白这应该意味着我可以列出文件(例如这里),但我不能。
will@wrmpb /p/t/permissions> ls -al
total 0
drwxr-xr-x 3 will wheel 102 4 Oct 08:30 .
drwxrwxrwt 16 root wheel 544 4 Oct 08:30 ..
dr-------- 3 will wheel 102 4 Oct 08:42 d
will@wrmpb /p/t/permissions> ls d
will@wrmpb /p/t/permissions>
Run Code Online (Sandbox Code Playgroud)
如果我更改写入和执行的权限,我可以看到该文件。
will@wrmpb /p/t/permissions> chmod 500 d
will@wrmpb /p/t/permissions> ls d
f
will@wrmpb /p/t/permissions>
Run Code Online (Sandbox Code Playgroud)
为什么是这样?我正在使用 MacOS。
编辑:参考@ccorn 的回答,我使用的是鱼并type ls
给出以下内容:
will@wrmpb /p/t/permissions> type ls
ls is a function with definition
function ls --description 'List …
Run Code Online (Sandbox Code Playgroud)