You must own a file or directory (or have root permission) to be able to change its owner.
Become superuser.
List the file permissions.
# ls -l filename |
|
-l |
Displays the long listing, which includes the owner of the file, displayed in the third column. |
|
filename |
Is the specified file or directory. |
# chown new-owner filename |
Ownership is assigned to the new owner you specify.
Verify the file ownership change.
# ls -l filename |
# ls -l quest -rw-r--r-- 1 fred staff 6023 Aug 5 12:06 quest # chown ignatz quest # ls -l quest -rw-r--r-- 1 ignatz staff 6023 Aug 5 12:06 quest |