判断路径是否存在 #!/bin/bash # if [ -f "filepath" ] then echo 'exists' else echo 'not exists' fi 参数说明-f文件-d目录