LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1065|回复: 2

如何判断一个目录是不是另一个目录的软链接(内空)

[复制链接]
发表于 2005-6-23 11:32:23 | 显示全部楼层 |阅读模式
如何判断一个目录是不是另一个目录的软链接
发表于 2005-6-23 11:33:59 | 显示全部楼层
Post by downcloud
如何判断一个目录是不是另一个目录的软链接


判断ls -a的输出的第一个字母是否是l
回复 支持 反对

使用道具 举报

发表于 2005-6-23 12:12:02 | 显示全部楼层
man bash: section CONDITIONAL EXPRESSIONS

       -a file
              True if file exists.
       -b file
              True if file exists and is a block special file.
       -c file
              True if file exists and is a character special file.
       -d file
              True if file exists and is a directory.
       -e file
              True if file exists.
       -f file
              True if file exists and is a regular file.
       -g file
              True if file exists and is set-group-id.
       -h file
              True if file exists and is a symbolic link.
       -k file
              True if file exists and its ``sticky'' bit is set.
       -p file
              True if file exists and is a named pipe (FIFO).
       -r file
              True if file exists and is readable.
       -s file
              True if file exists and has a size greater than zero.
       -t fd  True if file descriptor fd is open and refers to a terminal.
       -u file
              True if file exists and its set-user-id bit is set.
       -w file
              True if file exists and is writable.
       -x file
              True if file exists and is executable.
       -O file
              True if file exists and is owned by the effective user id.
       -G file
              True if file exists and is owned by the effective group id.
       -L file
              True if file exists and is a symbolic link.
       -S file
              True if file exists and is a socket.
       -N file
              True if file exists and has been modified since it was last read.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表