小编heu*_*vy6的帖子

Linux 'ls' 命令和目录权限 - “无法访问 /tmp/restricted/foo*: 没有这样的文件或目录”

为什么一个命令有效而另一个命令无效\xe2\x80\x99t?我找到了一些远程相关的文章,但我无法理解它们。

\n
$ sudo ls -la /tmp/restricted\ntotal 12\ndrwxr-x---.  2 root root    42 Mar 17 17:40 .\ndrwxrwxrwt. 12 root root 12288 Mar 17 17:37 ..\n-rwxrwxr-x.  1 root tms      0 Mar 17 17:22 foo1\n-rwxrwxr-x.  1 root tms      0 Mar 17 17:22 foo2\n-rwxrwxr-x.  1 root tms      0 Mar 17 17:22 foo3\n\n$ sudo ls -a /tmp/restricted/foo*\nls: cannot access /tmp/restricted/foo*: No such file or directory\n
Run Code Online (Sandbox Code Playgroud)\n

请注意,如果我将 /tmp/restricted 上的权限更改为 755 而不是 750,则两个命令都会成功:

\n
$ sudo chmod 755 /tmp/restricted/\n\n$ sudo ls -la /tmp/restricted\ntotal 12\ndrwxr-xr-x.  2 root …
Run Code Online (Sandbox Code Playgroud)

ls sudo

3
推荐指数
1
解决办法
2078
查看次数

标签 统计

ls ×1

sudo ×1