Posted on 2008-08-12 22:34
Prayer 閱讀(469)
評論(0) 編輯 收藏 引用 所屬分類:
Shell
shell中的一些常用,但是很難記住的簡潔判斷符號,把他們拉出來。
-r file |當(dāng)file是一個(gè)可讀文件時(shí),返回True
-w file |當(dāng)file是一個(gè)可寫文件時(shí),返回True
-x file |當(dāng)file是一個(gè)可執(zhí)行文件時(shí),返回True
-e file |當(dāng)file存在時(shí),返回True
-o file |當(dāng)file文件的所有者是當(dāng)前用戶時(shí),返回True
-z file |當(dāng)file長度為0時(shí),返回True
-f file |當(dāng)file是一個(gè)普通文件時(shí),返回True
-d file |當(dāng)file是一個(gè)目錄時(shí),返回True
-d file |當(dāng)file是一個(gè)目錄時(shí),返回 True
-f file |當(dāng)file是一個(gè)普通文件時(shí),返回 True
-r file |當(dāng)file是一個(gè)刻讀文件時(shí),返回 True
-s file |當(dāng)file文件長度大于0時(shí),返回 True
-w file |當(dāng)file是一個(gè)可寫文件時(shí),返回 True
-x file |當(dāng)file是一個(gè)可執(zhí)行文件時(shí),返回 True
-n str | 當(dāng)str的長度大于0時(shí),返回True
-z str | 當(dāng)str的長度是0時(shí),返回True
if 【-L directory】 判斷是否有l(wèi)ink