linux命令用于读写和可执行权限

Ary*_*yan 0 linux permissions command read-write

我正在linux盒子上选择一些路径进行安装.例如/ var/test/installer如何检查该路径的读,写和执行权限是否可用?

我确实试过"查找命令",但没有取得很大的成功.

伙计们,做"ls -l"并没有帮助我.这是一个真正的问题......我的/ var分区没有执行权限.我可以通过在/ var type ext3上使用"mount"命令ie> mount/dev/sda1来看到(rw,noexec,nosuid,nodev,noatime)

但是ls -l表示/ var ie下的任何文件夹./ var/test/install显示了读,写和执行权限.

所以我只看到grep mount命令检查noexec的方法.

你的意见.

提前致谢.

===============================================

我最终理解的是,我必须检查两级权限

  1. Mount Point的权限

    使用"mount"命令或检查/ etc/fstab文件

  2. 单个文件夹的权限

    Usinf"ls -l"命令

这解决了我的问题.

Big*_*ike 6

看一下这个test命令

从联机帮助页

       -c FILE
          FILE exists and is character special

       -d FILE
          FILE exists and is a directory

       -e FILE
          FILE exists

       -f FILE
          FILE exists and is a regular file

       -g FILE
          FILE exists and is set-group-ID

       -G FILE
          FILE exists and is owned by the effective group ID

       -h FILE
          FILE exists and is a symbolic link (same as -L)

       -k FILE
          FILE exists and has its sticky bit set

       -L FILE
          FILE exists and is a symbolic link (same as -h)

       -O FILE
          FILE exists and is owned by the effective user ID

       -p FILE
          FILE exists and is a named pipe

       -r FILE
          FILE exists and read permission is granted

       -s FILE
          FILE exists and has a size greater than zero

       -S FILE
          FILE exists and is a socket

       -t FD  file descriptor FD is opened on a terminal

       -u FILE
          FILE exists and its set-user-ID bit is set

       -w FILE
          FILE exists and write permission is granted

       -x FILE
          FILE exists and execute (or search) permission is granted
Run Code Online (Sandbox Code Playgroud)

一个好男人的页面

  • 如果(test -x somefile)或if(test -w somefile)有什么困难? (2认同)