How to change permissions for a folder recursively
If you want to changes permissions for all files and folders recursively for Owner, Group and others there is an easy way to do it.
Let’s say you want a folder to be Read and Write for Owner and Group.
sudo chmod -R ug+rw /some/folder
The meaning for this command is:
- Just in case you need to act the root user, if you are the owner of the folder where you are working there is no need to use sudo.
- The command to change permissions to a file or folder
- Tells the command to act recursively
- This means _u_ser and _g_roup.
- This adds _r_ead and _w_rite permissions to files.
Now if you want to give all permissions for all users.
chmod ugo+rwx /some/file
As you can see ugo means _u_ser, _g_roup, and _o_ther and rwx is for _r_ead, w_rite and e_xecute.