test 命令

发布时间: 更新时间: 总字数:594 阅读时间:2m 作者:IP:上海 网址

test命令进行一些常用的判断操作

help

help test ...

使用

# 判断文件夹是否存在,返回值为0表示true,返回值为非0表示false
test -e /tmp
echo $?

if test -e /tmp; then
  echo "/tmp exist"
fi
本文总阅读量 次 本站总访问量 次 本站总访客数