How to change files owner and group in Linux?

VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)

To change a file’s owner or a group, you will need to use the ‘chown‘ command.

Here are some examples:

To change a single file owner, type in ‘chown newowner yourfile

To change a single file and group name, type in ‘chown newowner:newgroup yourfile

To change a directory, type in ‘chown -R newowner yourdirectory

* newowner = the new owner name
* newgroup = the new group name
* yourfile and yourdirectory = the name of the file or directory

For changing only the Group name, you can use the ‘chgrp’ command instead.  The syntax is the same as ‘chown’.

Also, remember you can always use the ‘man command’ if you need help on the syntax for a command in Linux.

Related Tech posts:

  1. How to Find a file by name in UNIX/Solaris/Linux?
  2. Linux Root Password
  3. I forgot my root password, how can I get into my system?
  4. Linux Server for ISPs and Hosters, What should be in it?
  5. Linux: How to search and print command output?
  6. How to add Alias commands to Startup in Linux?

About the Author