Sunday, 20 January 2013

chown

You can change the owner of a file with the chown command. Here is a file:

UBUNTU > ls -l
total 0
-rw-rw-r-- 1 andrew users 0 Aug 22 22:09 file1
UBUNTU >

The file is owned by andrew. If you want to change the owner to fred, you can do so as follows:

UBUNTU > sudo chown fred file1
UBUNTU > ls -l
total 0
-rw-rw-r-- 1 fred users 0 Aug 22 22:09 file1
UBUNTU >