find command

* 把所有副檔名為 .sh 的權限, 改為775
find . -type f -name *.sh -exec chmod 775 {} \;

* 把所有目錄的權限, 改為664
find . -type d -exec chmod 664 {} \;

* 找所有檔案屬性是execut
find . -type f -exec file {} \; | grep execut

* 找檔名為xxx.c的檔案
find . -name xxx.c

* 找權限0777的檔案
find . -type f -perm 0777

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *