Linux Interview Questions and Answers

Real scenario-based questions, a free 20-page Linux guide, and practice exercises — the first guide page is open to everyone, no account required.

Free Linux interview questions

A free sample — one beginner, one intermediate, one advanced — with the full answer shown below each question.

BeginnerHow do you find which process is using a specific port?

sudo lsof -i :<port> or sudo netstat -tulpn | grep <port> — both show the process ID bound to that port, which you can then inspect with ps -p <pid> or kill with kill <pid>.

IntermediateA cron job runs fine when triggered manually but silently fails only on weekends. What would you check?

Check the actual cron schedule syntax first — a day-of-week field typo is the most common cause of this exact symptom. Also check whether a weekend maintenance window (backups, a different cron user's job) is competing for a resource the job needs, and confirm the cron daemon's timezone matches what you assumed when writing the schedule.

AdvancedA recursive `chown`/`chmod` across a massive directory tree is taking forever and blocking a deployment. What's a safer, faster approach?

Run it in the background and let the deploy proceed independently if ordering allows, use `find` with `-exec` and parallelism (or `xargs -P`) instead of a single recursive command, or — better — avoid needing a mass permission fix at deploy time at all by getting the base image/provisioning to create files with correct ownership from the start.

Learn Linux in depth, free to start

A 20-page guide that starts from connecting to a server for the very first time and goes through real incidents — a full disk from a runaway log, a systemd service hardened for real, LVM grown live. The first page is open to everyone, signed in or not.

See the full 20-page Linux guide →

Practice Linux for real, in the browser

Lock down an open sshd_config, diagnose “no space left on device” with bytes free but zero inodes, or recover commits from a detached HEAD with git reflog — all in a simulated terminal.

Try the Linux practice exercises →

Linux interview FAQ

What are the most commonly asked Linux interview questions for DevOps?

Interviewers usually describe a broken server — a disk reporting free space but still "no space left on device", a service that works by hand but fails under cron, a process holding a deleted file open — and ask what you'd check first, rather than asking you to define a command.

Do I need to memorize every Linux command for an interview?

No. What matters is knowing which tool answers which question (disk space vs. inodes, a hung process vs. a crashed one) and being able to reason through an unfamiliar situation using man pages and first principles, the way you would on the job.

How deep should I know Linux internals — processes, signals, permissions?

Deep enough to explain WHY something broke, not just which command fixes it: why SIGTERM without an exec wrapper can leave a process ignoring it, why a deleted-but-open file doesn't free disk space until the process closes it, why an empty variable can turn "rm -rf $DIR/*" into something catastrophic.

How do I practice Linux without installing a VM?

Work through fix-the-config exercises and simulated-terminal incidents graded on real command behavior first — locking down sshd_config, recovering from a full disk, tracing a real log — before you ever need to spin up a server of your own.

Starting from zero? Read the step-by-step DevOps career roadmap →

The rest of the guide is waiting.

Create a free account to track your progress through the guide, pass the end-of-page quizzes, and take a full-length Linux readiness check.