1753506 Members
6520 Online
108794 Solutions
New Discussion юеВ

Chmod

 
SOLVED
Go to solution
Jeffrey W. Stewart
Frequent Advisor

Chmod

I have a directory hp3070/boards
The boards directory has items like
724781
724782

In each of the 724xxx directories are other directories and files. The directories I am interested in are the analog, digital, fixture, and mixed. Let's say I need to modify the analog directory in each of the 724xxx directories. Would the path be /hp3070/boards/*/analog? If the path is correct can u also uses chmod and have,
find /hp3070/boards/*/analog | chmod 775 *

I have been trying to use the find command and now thinking I may need to use the grep command.

6 REPLIES 6
Manuel Plaza
Regular Advisor

Re: Chmod

Hi Jeffrey,

You must execute:

find /hp3070/boards/*/analog -exec chmod 775 {} \;

Regards,

Manuel




Stefan Schulz
Honored Contributor
Solution

Re: Chmod

I would use:

find /hp3070/boards -type d -name analog | xargs chmod 755

This will search trough your directory findign all directories (-type d) with the name analog. The resutlign list is piped to chmod with the xargs command.

This will set the permissions to 755 to all directories called analog. If you need to change the permissions for files and directories under this analog directory you have to use chmod -R.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Pedro Sousa
Honored Contributor

Re: Chmod

It's easy:
chmod -R 775 /hp3070/boards/*/analog

this will change every directory, and sub-directories, under analog (included).
good luck.
Vincenzo Restuccia
Honored Contributor

Re: Chmod

ll /hp3070/boards/*/analog|awk ' {print $9}'|xargs chmod 755

Carlos Fernandez Riera
Honored Contributor

Re: Chmod

If you want to chmod all files and directorys down :be

chmod -R /hp3070/boards/*/analog

If you want to chmos only directorys then you need to use find:

find /hp3070/boards/*/analog -type d | xargs chmod 755



Pedro: I was skiped yuor replay, but as i had wrote mine yet ...


unsupported
Jeffrey W. Stewart
Frequent Advisor

Re: Chmod

Solution in thread