How to recursively change permission only to files

  • Change files permissions using the following command :

find . -type f -exec chmod 644 {} \;

This example sets permissions to “644”. You may change it to what ever you need. Permissions will be changed to all files including all files in 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