Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

chown - Linux command line tool to change the owner/group of a file

Date: 2007-07-29 00:00:00 -0400

chown

Changes the owner or the group the file is associated with.

Usage

chown [options] owner file-list chown [options] owner:group file-list chown [options] :group file-list

Keep in mind that only root can change the owner of a file and only a user who belongs to the new group can change the group a file is associated with (also root can do this).

The owner is the user who will be the new owner of the file-list. The file-list are the files or file which is going to change its owner.

Options

-c
Displays a message for each fiel whose ownership or group is changed
--dereference
Changes the ownership/group of the files symbolic links point to, not the symbolic links themselves. The default is --no-dereference.
-f
Prevents chown from displaying error messages when it is unable to change the ownership/group of a file
-R
When you include directories in the file-list this options makes all the files in that directory to be affected by the command
Examples chown jose:contabilidad /home/account/ -R This is going to make all files inside /home/account/ and its subdirectories to belong to jose and to be associated with the group contabilidad.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.