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.

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

Happy scripting.

Tags: ,

Leave a Reply