How to recursively change permission only to directories

  • Change directories permissions using the following command :

find . -type d -exec chmod 755 {} \;

This example sets permissions to “755”. You may change it to what ever you need. Permissions will be changed to all directories including all subdirectories. “.” means to execute command on local directory. You may change “.” to any path.

  • Check that permissions have been changed :

ls -lha
  • DONE!

  • P. S. :

    N.B.! You might want to make sure you have enough privileges to run this command or use SUDO.

Leave a Reply