#文件
$ [ -e filename ] && echo "Found" || "Not found"
#目录
$ [ -f filename ] && echo "Foudn" || "Not found"
[参考]http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/
#文件
$ [ -e filename ] && echo "Found" || "Not found"
#目录
$ [ -f filename ] && echo "Foudn" || "Not found"
[参考]http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/