Tools & Commands · Linux and Windows Commands
chown
Files · Beginner
Changes the user and group that own a Unix file or directory. Doing so usually requires administrator privilege.
Ownership and permissions work together. This command changes who the permission bits refer to. It does not by itself change those bits.
Example: chown ada:staff notes.txt makes ada the owner and staff the group.
Command
Platform: Linux and macOS
chown ada:staff notes.txt
The name before the colon is the new user. The name after it is the new group. The command fails if you lack privilege.
Common misconception
- Changing the owner does not replace the need to set the permission bits correctly.