Change Ownership (LINUX)

The chown command allows you to change the ownership of a file :

chown [options] newowner files chown [options] --reference=filename files

Options
-c, --changes
Print information about files that are changed.
--dereference Follow symbolic links.
-f, --silent, --quiet Do not print error messages about files that cannot be changed.
-h, --no-dereference Change the ownership of each symbolic link (on systems that allow it), rather than the referenced file.
-v, --verbose Print information about all files that chown attempts to change, whether or not they are actually changed.
-R, --recursive Traverse subdirectories recursively, applying changes.
--reference=filename Change owner to the owner of filename instead of specifying a new owner explicitly.
--help Print help message and then exit.
--version Print version information and then exit.


Example:

chown -R newoner_username directory1

No comments:

Recent Posts