chown
The command that changes which user, and optionally which group, owns a file.
In more detail
Write user:group to change both at once. Giving a file to someone else needs root, which is why chown nearly always appears after sudo.
Example
sudo chown ada:staff report.txtRelated terms
- chgrp — The command that changes the group that owns a file.
- file permissions — Rules on each file saying which user and group own it and who may read, write or run it.
- sudo — A command that runs another command with administrator (root) rights after checking you are allowed to.
Taught in
- Permissions And Ownership — Bash Scripting & Command Line Automation
- kube-bench: Ten Failures On A Fresh Cluster — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Logins, su, sudo And SSH Between Hosts — Red Hat Certified System Administrator (EX200) Exam Prep
- Diagnosing Permission Problems — Red Hat Certified System Administrator (EX200) Exam Prep
- VFAT, ext4 And XFS: Create, Mount, Use — Red Hat Certified System Administrator (EX200) Exam Prep
- Root Over SSH From Anywhere: Keys, sshd, setuid Files And Attributes — CompTIA Linux+ (XK0-006) Exam Prep