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 →
- What is the difference between ps aux and ps -ef?
Both list every process on the system. ps aux uses BSD-style options and shows %CPU, %MEM and memory sizes; ps -ef uses the POSIX style and shows the parent PID (PPID) and full start time. Choose aux for resource use and -ef for process relationships.
BeginnerQuick answer1 min read - What is the difference between running a command with & and with nohup?
& only puts the command in the background of the current shell; it can still die when the terminal closes. nohup makes the command ignore the hangup signal, so it keeps running after logout, and sends its output to nohup.out unless redirected.
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 - What is the difference between systemctl start and systemctl enable?
start runs a service right now, while enable makes it start automatically at boot. They are independent: a service can be running but disabled, or enabled but stopped. systemctl enable --now does both in one command.
BeginnerQuick answer1 min read - What is the purpose of the /etc directory in Linux?
/etc holds system-wide configuration files, mostly plain text, such as user accounts, network settings, service configs and the package manager's source lists. Programs read them at start-up, so editing a file here changes how the system behaves.
BeginnerQuick answer1 min read - When should you use less instead of cat?
cat dumps the whole file to the terminal at once, which suits short files and pipelines. less opens a scrollable pager that loads lazily, lets you search with / and quit with q, so it is the right tool for large files.
BeginnerQuick answer1 min read