Devices Linux Filesystems Filesystem Hierarchy Standard
Manage File Permissions and Ownership
This article explains how to view and modify file permissions and ownership on a Linux system.
In this lesson, we’ll explore how to view and modify file permissions and ownership on a Linux system. You’ll learn to inspect permission bits, change owners and groups, and apply both symbolic and numeric modes with chmod, chown, and chgrp.
Only root can change file owners. Prefix with sudo if necessary:
Copy
Ask AI
# Syntax: sudo chown <user>[:<group>] <file_or_directory>$ sudo chown jane family_dog.jpg$ ls -l-rw-r----- 1 jane wheel 49 Oct 27 14:41 family_dog.jpg# Change both owner and group in one go:$ sudo chown aaron:family family_dog.jpg$ ls -l-rw-r----- 1 aaron family 49 Oct 27 14:41 family_dog.jpg
$ ls -l-r--r----- 1 aaron family 49 Oct 27 14:41 family_dog.jpg$ chmod u+w family_dog.jpg$ ls -l-rw-r----- 1 aaron family 49 Oct 27 14:41 family_dog.jpg
$ chmod g=r family_dog.jpg$ ls -l-rw-r----- 1 aaron family 49 Oct 27 14:41 family_dog.jpg$ chmod g=rw family_dog.jpg$ ls -l-rw-rw---- 1 aaron family 49 Oct 27 14:41 family_dog.jpg