Understanding Linux: A Closer Look at File Permissions


There are three categories: User (the file’s owner), Group (the security group you’re in), and Other (for others). Each category allows to establish three permissions: r, w, and x to read, write, and execute a file, respectively. Permissions are denoted by three numbers: 4 for Read, 2 for Write, and 1 for Execute. As a quick reference, here is a table:

User Group Other
Read = 4 x x x
Write = 2 x
Execute = 1 x x x
Totals (4+2+1) = 7 (4 + 1) = 5 (4 + 1) = 5

The single-digit numbers are as follows for all three user categories:

Octal String representation Permissions
0 - - - no access
1 - - x execute
2 - w - write
3 - w x write and execute
4 r - - read
5 r - x read and execute
6 r w - read and write
7 r w x read, write and execute (full access)

Examples:

  • 777 - all can read/write/execute (full access).
  • 755 - owner can read/write/execute, group/others can read/execute.
  • 644 - owner can read/write, group/others can read only.
linux