0
0
Linux CLIscripting~5 mins

chmod (change permissions) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the chmod command do in Linux?
The chmod command changes the permissions of files or directories, controlling who can read, write, or execute them.
Click to reveal answer
beginner
What do the letters r, w, and x stand for in file permissions?
r means read permission, w means write permission, and x means execute permission.
Click to reveal answer
beginner
How do you give execute permission to the owner of a file named script.sh?
Use the command: chmod u+x script.sh. Here, u means user (owner), and +x adds execute permission.
Click to reveal answer
intermediate
What does the numeric mode 755 mean when used with chmod?
It means: owner can read, write, and execute (7), group can read and execute (5), others can read and execute (5).
Click to reveal answer
beginner
How would you remove write permission for others on a file named data.txt?
Use the command: chmod o-w data.txt. Here, o means others, and -w removes write permission.
Click to reveal answer
What does chmod 644 file.txt do?
AOwner can read/write; group and others can read only
BOwner can read/write/execute; group and others can read only
COwner can read only; group and others can read/write
DOwner, group, and others can read/write/execute
Which command adds execute permission for everyone on run.sh?
Achmod g+x run.sh
Bchmod u+x run.sh
Cchmod o+x run.sh
Dchmod +x run.sh
What does chmod u=rwx,g=rx,o= file do?
AOwner has read only; group has read and write; others have execute only
BOwner has all permissions; group can read and execute; others have no permissions
COwner has execute only; group has write only; others have read only
DOwner, group, and others have full permissions
Which symbol removes write permission from the group?
A-x
B+w
C-w
D+x
If a file has permissions -rwxr-xr--, what is the numeric mode?
A754
B755
C644
D700
Explain how to use symbolic modes with chmod to add and remove permissions.
Think about how you tell a friend to allow or block certain actions.
You got /5 concepts.
    Describe the difference between symbolic and numeric modes in chmod.
    One is like writing a sentence, the other is like a code number.
    You got /4 concepts.