How To Change Folder Owner In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To change the owner of a folder in Linux, you need to use the ‘chown’ command. This command allows you to change the user and group ownership of a file or directory.
Syntax: chown [options] user:group file/directory
Options:
-R : Recursively change the ownership of files and directories.
-v : Verbose output
-h : Affect symbolic links instead of any referenced file.
Example:
To change the owner of a folder named ‘my-folder’ to the user ‘myuser’ and the group ‘mygroup’, use the following command:
chown -R myuser:mygroup my-folder