Re: chmod for directories only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, Dec 01, 2008, Robert Moskowitz wrote:
> I want to change the permissions on directories, recursively to:
>
> drwxr-xr-x
>
> but keep the files within the directory tree as:
>
> -rw-r--r--
>
> But I can't find an option for chmod to only affect directories.  I  
> suppose it won't hurt (in this case) to set the x for the files, but I  
> want some consistancy.

find . -type d | xargs chmod 755

Or if the directories may have whitespace

find . -type d -print0 | xargs -0 chmod 755

Bill
-- 
INTERNET:   bill@xxxxxxxxxxxxx  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

Property must be secured, or liberty cannot exist. -- John Adams
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux