How to change permissions and ownership of files recursively

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.

  • chown, chmod, permissions, recursively
  • 60 Users Found This Useful
Was this answer helpful?

Related Articles

How to flush your DNS cache

Your home computer creates a cache for all DNS settings. It does this to save time each time you...

What is the root login for my new VPS server?

The root login is the same password our system sent you in your welcome email. You just change...

What is the path to PERL?

The path to PERL in PERL script is:#!/usr/local/bin/perl

Do you troubleshoot scripts and apps?

Hello,Sorry, but troubleshooting sripts and apps needs to be done by the scipt maker or a...

How to use PHP-CLI

You would call '/usr/local/bin/php' if you need the php-cli binary, and '/usr/bin/php' if you...