David's Blog

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

| 4 留言

[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 則留言

  1. 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.

  2. 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!


Required fields are marked *.