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 you find and stop a process in Linux, and what is the difference between SIGTERM and SIGKILL?
Use ps or top to find the process ID, then kill to send it a signal. SIGTERM (15, the default) politely asks the process to exit so it can clean up, while SIGKILL (9) makes the kernel end it immediately and cannot be caught or ignored.
AdvancedIn-depth3 min read - What is a systemd timer, and how does it differ from cron?
A systemd timer is a .timer unit that starts a matching .service on a schedule or after boot. Unlike cron, its output goes to the journal, it can run missed jobs after downtime with Persistent=true, and it supports dependencies and resource limits.
AdvancedQuick answer1 min read - What is SSH local port forwarding, and when is it used?
ssh -L local_port:target_host:target_port user@server opens a port on your machine and tunnels traffic through the SSH server to the target. It lets you reach a service, such as a private database, that is only accessible from the server's network.
AdvancedQuick answer1 min read