Shell判断路径是否存在

判断路径是否存在

#!/bin/bash
#
if [ -f "filepath" ]
then
    echo 'exists'
else
    echo 'not exists'
fi
参数 说明
-f 文件
-d 目录

猜你喜欢

转载自blog.csdn.net/yao1500/article/details/106103431