0
0
Linux CLIscripting~20 mins

Permission types (read, write, execute) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Permission Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of the permission check command?
You run the command ls -l file.txt and see the permissions as -rw-r--r--. What does this mean for the file's owner?
AThe owner can only read the file.
BThe owner can read, write, and execute the file.
CThe owner can read and write the file, but cannot execute it.
DThe owner cannot access the file at all.
Attempts:
2 left
💡 Hint
Look at the first three permission characters after the dash.
💻 Command Output
intermediate
2:00remaining
What permission does 'chmod u+x file.sh' add?
You run chmod u+x file.sh. What permission is added to the file for the owner?
ARemoves read permission for the owner.
BAdds execute permission for the owner.
CAdds write permission for the owner.
DAdds execute permission for everyone.
Attempts:
2 left
💡 Hint
The 'u' stands for user (owner), and '+x' means add execute.
📝 Syntax
advanced
2:00remaining
Which command correctly removes write permission for group?
You want to remove write permission for the group on a file named data.txt. Which command does this correctly?
Achmod g-w data.txt
Bchmod -w g data.txt
Cchmod w-g data.txt
Dchmod g+w data.txt
Attempts:
2 left
💡 Hint
The syntax is 'chmod [who][+/-][permission] file'.
💻 Command Output
advanced
2:00remaining
What is the output of 'stat' showing permissions in octal?
You run stat -c '%a' script.sh and get 755. What does this mean for the file permissions?
AOwner has read, write, execute; group and others have read and execute.
BOwner has read and write; group and others have execute only.
COwner, group, and others all have read, write, and execute.
DOwner has execute only; group and others have no permissions.
Attempts:
2 left
💡 Hint
Octal 7 means read+write+execute; 5 means read+execute.
🚀 Application
expert
3:00remaining
How many files have execute permission for others?
You run ls -l and see these permissions for files:
-rw-r--r--
-rwxr-xr-x
-rw-rw-r--
-rwxrwxrwx
How many files have execute permission for others?
A0
B1
C3
D2
Attempts:
2 left
💡 Hint
Look at the last character in the permission string for others.