How do I interpret file permissions?

QuestionsQuestions8 SkillsProBasic Files OperationsOct, 02 2025
092

File permissions in Linux are represented by a series of characters that indicate what actions users can perform on a file or directory. Here's how to interpret them:

Format:

Permissions are displayed in a format like this:

-rw-r--r--

Breakdown:

  1. File Type:

    • The first character indicates the type:
      • -: Regular file
      • d: Directory
      • l: Symbolic link
  2. Permissions:
    The next nine characters are divided into three groups of three:

    • Owner Permissions (first three characters):
      • r: Read permission
      • w: Write permission
      • x: Execute permission
    • Group Permissions (next three characters):
      • Same meanings as above, but for the group that owns the file.
    • Other Permissions (last three characters):
      • Same meanings as above, but for all other users.

Example:

For the permissions -rw-r--r--:

  • -: It's a regular file.
  • rw-: The owner can read and write, but not execute.
  • r--: The group can read, but not write or execute.
  • r--: Others can read, but not write or execute.

Numeric Representation:

Permissions can also be represented numerically:

  • Read (r) = 4
  • Write (w) = 2
  • Execute (x) = 1

You can add these values to represent permissions:

  • rwx = 7 (4+2+1)
  • rw- = 6 (4+2+0)
  • r-- = 4 (4+0+0)

Example Numeric:

For -rw-r--r--, the numeric representation is 644:

  • Owner: rw- = 6
  • Group: r-- = 4
  • Others: r-- = 4

If you have more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!