[Linux] 只針對檔案或只針對目錄做遞迴chmod

[cc lang=”bash”]
chmod -R fubar/ 755
可是這樣會連帶目錄+檔案都變成775,這不是我要的啊~~ 我要目錄755檔案644這樣啊,難道我要一個一個去弄嗎,這樣超級蠢的說…


[cc lang=”bash”]
find ./ -type d -print0 | xargs -0 chmod 755

[cc lang=”bash”]
find ./ -type f -print0 | xargs -0 chmod 644

4 thoughts on “[Linux] 只針對檔案或只針對目錄做遞迴chmod”

  1. greencoffeebeanextractbenefits.webs.com

    Woah! I’m really loving the template/theme of this blog. It’s simple, yet effective.

    A lot of times it’s hard to get that “perfect balance” between superb usability and visual appearance. I must say that you’ve done a excellent job with this.
    Additionally, the blog loads very fast for me on Firefox.
    Excellent Blog!

  2. My partner and I stumbled over here by a different page and thought I might
    as well check things out. I like what I see so now i am following you.
    Look forward to going over your web page again.

Leave a Comment

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