How to change permissions separately for files and directories

I wanted to change permissions so that all files within /tmp/some/directory will be 644 and all subdirectories 755.

cd /tmp/some/directory
chmod -R 0644 *
find . -type d -exec chmod 0755 {} \;

Happy scripting.

Tags: ,

Leave a Reply