關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 只針對檔案或目錄 chmod

    Posted on January 21st, 2009 Sam Tang 1 comment

    在 Unix Like 環境可以用 chmod 改變檔案或目錄的權限,以下方法可以只針對檔案或目錄 chmod:

    1. 在當前目錄下遁迴 chmod 檔案:
    find . -type f -exec chmod 0600 {} \;

    2. 在當前目錄下遁迴 chmod 目錄:
    find . -type d -exec chmod 0755 {} \;


     

    One response to “只針對檔案或目錄 chmod”

    1. 實用, 一直想搞清楚呢句cmd好耐, thx

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word