← Users & Permissions
Linux · Users & Permissions

How to read file permissions and ownership in Linux

Read file permissions and ownership with ls -l and stat, and understand the rwx and octal notation.


Read a file permissions and owner. In ls -l the first column is type plus owner/group/other rwx; stat shows the same as an octal number such as 0644.

# Long listing: perms, owner, group
ls -l <file>
ls -ld <dir>

# Owner, group, and octal mode
stat <file>
stat -c '%A %a %U %G %n' <file>

# Reminder: r=4 w=2 x=1, so rwxr-xr-x = 755
LinuxPermissionsls