Bird
Raised Fist0
Linux CLIscripting~20 mins

Permission notation (rwxrwxrwx) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Permission Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of ls -l permission part for a file with mode 754?
Given a file with permission mode 754, what will the permission notation rwxrwxrwx part look like in ls -l output?
A-rwxr-xr--
B-rwxr-xr-x
C-rwxr--r--
D-rwxrwxr--
Attempts:
2 left
💡 Hint
Remember that 7 means rwx, 5 means r-x, and 4 means r-- for user, group, and others respectively.
🧠 Conceptual
intermediate
1:30remaining
What does the permission notation -rw-r--r-- mean?
Interpret the permission notation -rw-r--r--. Which of the following is true?
AOwner can read and write; group and others can only read
BOwner can read, write and execute; group and others can read and execute
COwner can read only; group and others have no permissions
DOwner, group, and others all have read and write permissions
Attempts:
2 left
💡 Hint
Look at the letters for each user category: rw- means read and write, r-- means read only.
📝 Syntax
advanced
1:30remaining
Which command sets permissions to rwxr-x--- on a file named script.sh?
Choose the correct chmod command to set permissions to rwxr-x--- on script.sh.
Achmod 755 script.sh
Bchmod 700 script.sh
Cchmod 750 script.sh
Dchmod 754 script.sh
Attempts:
2 left
💡 Hint
Convert rwxr-x--- to numeric: rwx=7, r-x=5, ---=0.
🔧 Debug
advanced
1:30remaining
Why does chmod 777 file.txt pose a security risk?
Select the main reason why setting permissions to 777 on a file is risky.
AIt disables all permissions for group and others.
BIt allows anyone to read, write, and execute the file, which can lead to unauthorized changes or execution.
CIt restricts the owner from modifying the file.
DIt only allows the owner to execute the file.
Attempts:
2 left
💡 Hint
Think about what rwxrwxrwx means for all users.
🚀 Application
expert
2:00remaining
After running chmod u=rwx,g=rx,o= file.txt, what is the permission notation?
What is the exact permission notation shown by ls -l for file.txt after running chmod u=rwx,g=rx,o= file.txt?
A-rwxr--r--
B-rwxrwxrwx
C-rwxr-----
D-rwxr-x---
Attempts:
2 left
💡 Hint
u=rwx means owner has rwx, g=rx means group has r-x, o= means others have no permissions.

Practice

(1/5)
1. What does the permission notation rwxr-xr-- mean for the group?
easy
A. No permissions
B. Read, write, and execute permissions
C. Write and execute permissions only
D. Read and execute permissions only

Solution

  1. Step 1: Identify the group permission segment

    The permission string is divided into three groups: user (rwx), group (r-x), others (r--). The group segment is the middle three characters: r-x.
  2. Step 2: Interpret the group permissions

    In r-x, r means read, - means no write permission, and x means execute permission.
  3. Final Answer:

    Read and execute permissions only -> Option D
  4. Quick Check:

    Group = r-x = read + execute [OK]
Hint: Look at the middle three letters for group permissions [OK]
Common Mistakes:
  • Confusing user permissions with group permissions
  • Assuming dash means write permission
  • Mixing up execute (x) with write (w)
2. Which of the following is the correct permission notation for a file where others have only execute permission?
easy
A. rwxrwx--x
B. rwxrwxr--
C. rwxrwxrwx
D. rwxrwx---

Solution

  1. Step 1: Understand the position of others' permissions

    The permission string has three groups of three characters: user, group, others. The last three characters represent others' permissions.
  2. Step 2: Identify execute-only permission for others

    Execute permission is x, and no read or write means dashes -. So others' permissions should be --x.
  3. Step 3: Match the options

    rwxrwx--- ends with --- (no permissions).
    rwxrwxr-- ends with r-- (read only).
    rwxrwxrwx ends with rwx (all permissions).
    rwxrwx--x ends with --x (execute only).
  4. Final Answer:

    rwxrwx--x -> Option A
  5. Quick Check:

    Others execute permission = last x in string [OK]
Hint: Others' permissions are the last three characters [OK]
Common Mistakes:
  • Confusing read (r) with execute (x)
  • Ignoring the position of others' permissions
  • Assuming dashes mean execute permission
3. What is the numeric (octal) permission equivalent of rw-r--r--?
medium
A. 664
B. 644
C. 755
D. 777

Solution

  1. Step 1: Convert each permission group to octal

    Permissions are grouped as user (rw-), group (r--), others (r--).
    For each group, read = 4, write = 2, execute = 1, dash = 0.
    User: r(4) + w(2) + -(0) = 6
    Group: r(4) + -(0) + -(0) = 4
    Others: r(4) + -(0) + -(0) = 4
  2. Step 2: Combine the octal digits

    Combine user, group, others digits: 6 4 4
  3. Final Answer:

    644 -> Option B
  4. Quick Check:

    rw- = 6, r-- = 4, r-- = 4 [OK]
Hint: Add 4 for r, 2 for w, 1 for x in each group [OK]
Common Mistakes:
  • Mixing up write and execute values
  • Adding execute permission when not present
  • Confusing group and others positions
4. You see the permission string rwxr-xr-x on a file, but the owner cannot write to it. What is the likely cause?
medium
A. The write permission is missing for the owner
B. The file is a directory, not a file
C. The file is owned by a different user
D. The execute permission is missing for the owner

Solution

  1. Step 1: Analyze the permission string for owner

    The first three characters rwx mean the owner has read, write, and execute permissions.
  2. Step 2: Understand why owner cannot write despite permissions

    If the owner cannot write, but permissions show write allowed, the likely cause is that the current user is not the owner of the file. Permissions apply to the file's owner, group, and others accordingly.
  3. Final Answer:

    The file is owned by a different user -> Option C
  4. Quick Check:

    Owner write permission present but user mismatch [OK]
Hint: Check if you are the file owner when permissions seem correct [OK]
Common Mistakes:
  • Assuming permission string always matches current user rights
  • Confusing execute with write permission
  • Ignoring file ownership
5. You want to set a file permission so that the user has all permissions, the group can read and execute only, and others have no permissions. Which permission notation should you use?
hard
A. rwxr-x---
B. rwxrwxr--
C. rwxr-----
D. rwxr-xr-x

Solution

  1. Step 1: Define permissions for each group

    User: all permissions = rwx
    Group: read and execute = r-x
    Others: no permissions = ---
  2. Step 2: Combine the permission groups

    Concatenate user, group, others: rwx + r-x + --- = rwxr-x---
  3. Final Answer:

    rwxr-x--- -> Option A
  4. Quick Check:

    User=all, Group=read+execute, Others=none [OK]
Hint: Write permissions group by group: user, group, others [OK]
Common Mistakes:
  • Giving others permissions when none required
  • Confusing write and execute for group
  • Mixing order of permission groups
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard