Interview Q&A / Linux & Shell
Linux & Shell interview questions
Permissions, processes, pipes and the commands you are expected to know cold.
Prefer rapid revision? Practise Linux & Shell short interview answers →
- How do file permissions work in Linux, and what do chmod 755 and 644 mean?
Every file has read, write and execute permissions for three groups of people - the owner, the group and everyone else. chmod changes them; 755 means the owner can do everything while others can only read and execute, and 644 means the owner can read and write while others can only read.
BeginnerIn-depth3 min read - How do you change a file's owner and group with chown?
Use chown user file to change the owner and chown user:group file to change both. Add -R to apply it to a whole directory tree. Only root can give files away to another user; chgrp changes just the group.
BeginnerQuick answer1 min read - What is the difference between symbolic and octal modes in chmod?
Octal mode sets all permissions at once with numbers such as 640. Symbolic mode edits specific bits with letters, such as u+x or go-w, leaving the rest unchanged. Symbolic is safer for small tweaks; octal is better for setting a known final state.
BeginnerQuick answer1 min read