How To Chown Recursively In Linux? – POFTUT

How To Chown Recursively In Linux?

Linux files and folders have owners. Owners are required to control permissions. Which user user can access which files. User root created file will be owned by user root. But what will happen we want to change owner.

Simply Recursively Change Files and Directories Owner User and Group

We will issue the user, group information and directory to start with recursively.

We can check new owner user and group with

Simply Recursively Change Files and Directories Owner User and Group

Simply Recursively Change Files and Directories Owner User and Group

We will change owner and group which is specified with ismail:ismail  in /home/ismail directory recursively. Keep in mind that to change owner user and group of files we need root privileges.

Specify File Types

While changing owner user and groups we can specify file types to recursively change.

We use find command to  find specified file type for specified path recursively and send these files as input to chown

Specify File Types

Specify File Types

In this example find command is searching in /home/ismail for pdf extensions and run chown command for all files it founds.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)