Quick Shot: Recursive chmod

Been spending a lot of time working on a Linux server. Just a handy command line option I refreshed in my mind.

Sometimes, you need to change the permissions on a folder. You use chmod to do this. The command is simple:

chmod ### folder

where ### is the permissions you want to give the folder and folder is the name of the folder.

But what if you want to change permissions not only for the folder but any subfolders as well. Use the -R option to do this:

chmod -R ### folder

where ### is the permissions you want to give the folder and folder is the name of the folder.

Quick reminder the values for the permissions are

  • 4 – read
  • 2 – write
  • 1 – execute

They add together to create a permission. They are entered in the order of user/group/other. 7 is complete control. So, to give the user complete control and everyone else read and execute permission, you would use 755 for the option.