if [ -f "/home/test/a" ]; then echo myfile exists else echo myfile dose not exists fi [ -e FILE ] 如果 FILE 存在则为真。[ -f FILE ] 如果 FILE 存在且是一个普通文件则为真。