click below
click below
Normal Size Small Size show me how
Ownership
chown and chgrp
Question | Answer |
---|---|
Change the ownership of a file or directory | chown |
chown Options: Change the ownership of a file recursively throughout the directory tree | chown -R |
chown Options: Change the file ownership only | chown {user} |
chown Example: Make jsmith the owner of all the files in the /lectures directory | chown jsmith -R /lectures |
chown Options: Change the user and group ownership of the file | chown user:group |
Chown Example: Make badams the USER owner and sales the GROUP owner of the file reports in the /july directory | chown badams:sales /july/reports |
chown Options: Change the group ownership only | chown :group or chown .group |
chown Example: Make the yoga group the owner of all the files in the /classes directory | chown :yoga -R /classes chown .yoga -R /classes |
change the ownership of a file or directory | chgrp |
chgrp Example: makes the buyers group the group owner of /may/report file | chgrp buyers /may/report |