Operating System - HP-UX
1833861 Members
2138 Online
110063 Solutions
New Discussion

Change Permissions in dir/sub-dirs

 
SOLVED
Go to solution
panchpan
Regular Advisor

Change Permissions in dir/sub-dirs

Hello.
I have one main dir , which might have 100s of sub-dirs and files in it. Is there any command to be used for changing permissions to 755 of each components under main dir?

Thank you!
3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: Change Permissions in dir/sub-dirs

Hi,
chmod -R

see "man chmod"
Pete Randall
Outstanding Contributor

Re: Change Permissions in dir/sub-dirs

The "-R" option of chmod is the obvious solution. If you want or need more flexibility, perhaps to apply different permissions to subdirectories than to the files within, you could use the find command:

find /start_dir -type d |xargs chmod NNN

-and-

find /start_dir -type f |xargs chmod NNN


Pete

Pete
panchpan
Regular Advisor

Re: Change Permissions in dir/sub-dirs

Thank you!