chown (change owner)
Changes the owner of a file.
Format: chown newowner filename
Examples: chown janet file29.txt
The file file29.txt now has the owner janet. Only the owner of the file or the super user can change the owner.
Opt | What It Does | Example |
---|---|---|
-c | Display info about file changes |
chown -c janet file2 changed group of 'file2' to janet |
-R | Make changes in all subdirectories |
chown -R janet file3 changes file3 in any subdirectories, as well |
Get Spring Into Linux® now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.