Use the following procedure to change the ownership of a file.
Change the owner of a file by using the chown command.
# chown new-owner filename |
new-owner |
Specifies the user name or UID of the new owner of the file or directory. |
filename |
Specifies the file or directory. |
Verify that the owner of the file has changed.
# ls -l filename |
In the following example, the ownership on myfile is changed to the user rimmer.
# chown rimmer myfile # ls -l myfile -rw-r--r-- 1 rimmer scifi 112640 May 24 10:49 myfile |