Change Permissions of Files Only
I recently had need to change the permissions of a large number of files and directories. The directories needed permissions of 755, and the files needed 644. Since there were several nested directories, this was going to be a real chore until I figured out you could use the find command to help.
find . -type d -exec chmod 755 {} \;
The above command looks at all items in the current directory, and changes the permissions of each directory to 755. Use the following to change permissions of files instead of directories:
find . -type f -exec chmod 644 {} \;







No comments
Jump to comment form | comments rss [?] | trackback uri [?]