Permissions & Ownership
Overview
Every file has permissions for three classes: the owner (user), the group, and others. Each class can read (r), write (w), and execute (x).
In ls -l output, the first column looks like -rwxr-xr--: a type character followed by the three permission triples. They map to octal numbers where r=4, w=2, x=1.
chmod changes permissions (e.g. 755 or u+x), while chown changes the owning user and group. Use the chmod Calculator tool to convert between octal and symbolic.
Cheatsheet
ls -l fileView permissions and ownershipchmod 644 filerw for owner, r for group/otherschmod +x script.shMake a script executablechown user:group fileChange owner and groupumaskShow default permission maskTry it
A safe, simulated terminal. Run the suggested commands to see typical output.
Type a command and press Enter, or click a suggestion below to run it.
Quick quiz
1. What octal value means read+write+execute for the owner only, nothing for others?
2. Which permission character allows running a file as a program?