Return to Snippet

Revision: 28181
at July 3, 2010 00:20 by beneberle


Updated Code
// This will recursively search your directory tree (starting at dir 'dot') and chmod 755 all directories only.
find . -type d -exec chmod 755 {} \;

// Similarly, the following will chmod all files only (and ignore the directories):
find . -type f -exec chmod 644 {} \;

// Change files of only a specific type/extension (pdf in this case):
find ./ -name *.pdf -exec chmod 755 {} \;

Revision: 28180
at July 3, 2010 00:15 by beneberle


Updated Code
// This will recursively search your directory tree (starting at dir 'dot') and chmod 755 all directories only.
find . -type d -exec chmod 755 {} \;

// Similarly, the following will chmod all files only (and ignore the directories):
find . -type f -exec chmod 644 {} \;

Revision: 28179
at July 3, 2010 00:14 by beneberle


Initial Code
// This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.
find . -type d -exec chmod 755 {} \;

// Similarly, the following will chmod all files only (and ignore the directories):
find . -type f -exec chmod 644 {} \;

Initial URL

                                

Initial Description

                                

Initial Title
UNIX: Recursive chmod Directories or Files

Initial Tags
unix

Initial Language
Bash