Changing file or directory ownership
Use the chown command to change the owner of your files.
When you specify the -R option,
the chown command recursively descends through the directory
structure from the specified directory. When symbolic links are encountered,
the ownership of the file or directory pointed to by the link is changed;
the ownership of the symbolic link is not changed.
Note: Only the root
user can change the owner of another file. Errors are
not displayed when the -f option is specified.
For
example, to change the owner of the program.c file, type
the following:
chown jim program.c
The user-access
permissions for the program.c file now apply to jim
.
As the owner, jim
can use the chmod command to permit or deny
other users access to the program.c file.
See the chown command for the complete syntax.