Windows
Linux
Security & Permissions
File System
Windows takeown equivalent in Linux
Changes the user or group that owns a file or directory.
Windows
→
takeown
Linux equivalents
sudo chown user:group path
sudo chown user:group path
sudo chown user:group path
Overview
What this command does
Changes the user or group that owns a file or directory.
Migration tip: Linux separates ownership from permissions. Use
chown for owner/group changes and chmod for read, write and execute permissions.Practical tasks
Common use cases
Change file ownership
Changes the user or group that owns a file or directory.
sudo chown kris file.txt
Change the owner
sudo chown kris:users file.txt
Change owner and group
sudo chown -R kris:users folder/
Change ownership recursively
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sudo chown kris file.txt
sudo chown kris:users file.txt
sudo chown -R kris:users folder/
Walkthrough
Examples with explanations
sudo chown kris file.txt # set a new owner
sudo chown kris:users file.txt # set owner and group
sudo chown -R kris:users folder/ # change an entire directory tree
Reference
Common options and variations
| Command or option | Use |
|---|---|
sudo chown kris file.txt | Change the owner |
sudo chown kris:users file.txt | Change owner and group |
sudo chown -R kris:users folder/ | Change ownership recursively |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | sudo chown user:group path |
Same command on this distribution. |
| Fedora | same command | sudo chown user:group path |
Same command on this distribution. |
| Arch | same command | sudo chown user:group path |
Same command on this distribution. |
Important
What to watch out for
Recursive ownership changes can affect many files. Verify the target path before using chown -R.
Keep learning