How to change permissions and ownership of files recursively Print

  • chown, chmod, permissions, recursively
  • 60

To change files or folders on a Linux server, you typically use a command line program like Putty or Tera Term. in your WHM it's called a terminal and in cPanel it's the SSH tool. All of these allow for commands to run once you're logged in.

To change file permissions recursively you would run a command like this: 

chmod -R MODE DIRECTORY

MODE would be the permissions and the directory is where the changes will start. For example:

chmod -R 755 /home/username

To change file ownership recursively you would run a command like this: 

chown -R <owner> <folder_1> <folder_2>

An example would be: 

chown -R username /home/username

There's more options with chmod and chown, but this will get 99% of what needs to be done when using these tools.


Was this answer helpful?

« Back