目錄判斷:
path="/home" #if [ ! -d ${path} ];then if [ -d ${path} ];then echo dir ${path} exist! else echo dir ${path} not exist! fi
免費(fèi)學(xué)習(xí)視頻教程分享:linux視頻教程
文件判斷:
file="/home/log.txt" if [ -f ${file} ];then echo file ${file} exist! else echo file ${file} not exist! fi
相關(guān)文章教程推薦:linux教程