Master the chown command to assign files to the right user and group quickly. 15.11.2025 | reading time: 2 min Who owns a file decides who can modify it; `chown` changes that owner and optionally the group. Learn by doing: change owners, apply groups, and fix permissions the safe way. Hands-on example Imagine a config file currently owned by root that must be transferred to the deploy user; run these commands to observe the change: ``` $ ls -l config.ini -rw-r--r-- 1 root root 1024 Nov 15 12:00 config.ini $ sudo chown deploy config.ini $ ls -l config.ini -rw-r--r-- 1 deploy root 1024 Nov 15 12:00 config.ini ``` To change both owner and group in one step use `sudo chown deploy:appgroup config.ini` and to apply to a whole tree add `-R`. Options and behavior to know Use `-R` for recursion, `-v` to see changes, and `--reference=RFILE` to copy ownership from another file; numeric IDs also work, for example `chown 1001:1001 file`. Note: only root or a process with the appropriate capability may change a file's owner to another user, so ordinary users cannot arbitrarily reassign ownership. Common pitfalls and use cases Web content, deployment directories and restored backups often need ownership fixes; use `chown` after `rsync` or `tar` restores. Beware of network filesystems and UID mismatches, and avoid changing ownership blindly in system directories—wrong owners break services. Next steps Practice on a disposable VM: create files, switch owners, inspect with `ls -l` and `stat`, and try recursive and reference-based changes to build muscle memory. If you want to dive deeper into Linux administration, study for CompTIA Linux+ or LPIC-1 and consider intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities security scripting troubleshooting