Linux Shell bash判断文件或文件夹是否存在
判断文件夹是否存在# -d 参数判断文件夹是否存在,不存在则创建,注意 [ 和 -d 之间需要空格,双引号要不要都可以if [ -d "test" ]; then echo "exist"else echo "not exist" mkdir testfi# ! 和 -d 之间也需要空格if [ ! -d "test" ]; then echo "not ex
原创
2016-08-31 17:18:55 ·
1122 阅读 ·
0 评论