Change permissions recursively in linux

Quite often when you are working with files and folders on a server for a web project you need to change the permissions for these files and folders. Especially if they are part of a web app and uploaded with FTP/SFTP. Most of the time the chmod command is enough, but sometimes you need to change a whole bunch of files and folders in a directory tree with different permissions for files and folders. This is easily done with the find command via a terminal over ssh.

Changes all files in my_folder to have have rw rw r (664) permission.

sudo find my_folder/ -type f -exec chmod 664 {} \;

Changes all folders (directories) in my_folder to have have rw rw r (775) permission.

sudo find my_folder/ -type d -exec chmod 775 {} \;

One Response to “Change permissions recursively in linux”

  • nike 6.0 oncore…

    Penelope Cruz also tends to make it towards the major in the checklist. She isn’t scared to wear bold colors, which include crimson wine red or deep blue, and pulls them off extremely properly. Her outstanding expertise for colour coordination and kna…

Leave a Reply

*