Linux and Shell Scripting Interview Questions for DevOps
25 Linux and Shell Scripting questions with answers for devops roles — 10 easy, 11 medium, 4 hard.
About Linux and Shell Scripting
Linux runs almost every server and container in production, so it is the base of all DevOps work. This topic covers file permissions, processes, systemd services, logs, networking commands and bash scripting with cron, plus the troubleshooting questions interviewers love: full disks, high CPU, OOM kills and SSH failures.
Explain Linux file permissions and what chmod 755 means.
Show answer
What is the difference between a hard link and a soft link?
Show answer
How do you manage a service with systemd?
Show answer
What is the difference between kill, kill -15 and kill -9?
Show answer
Explain stdin, stdout, stderr and what 2>&1 means.
Show answer
How do you schedule a cron job to run every day at 2:30 AM?
Show answer
Your app fails to start with 'address already in use' on port 8080. What do you do?
Show answer
What is the difference between sudo and su?
Show answer
Why do you want to build a career in DevOps?
Show answer
What is an inode in Linux?
Show answer
What is load average in Linux and how do you read it?
Show answer
What are zombie and orphan processes?
Show answer
What does set -euo pipefail do in a bash script?
Show answer
How do you find files larger than 100 MB and older than 7 days under /var/log?
Show answer
Write a bash script that checks whether a service is running and restarts it if not.
Show answer
How do you count unique client IP addresses in an nginx access log?
Show answer
Write a script that alerts when any disk partition is above 80 percent used.
Show answer
A production server is very slow. How do you troubleshoot high CPU usage?
Show answer
You suddenly cannot SSH into a Linux server. What do you check?
Show answer
Tell me about a time you automated a repetitive manual task.
Show answer
Explain the Linux boot process briefly.
Show answer
df shows the disk is 100 percent full but du does not find large files. What is happening?
Show answer
The kernel OOM killer keeps killing your application. How do you handle it?
Show answer
An application logs 'Too many open files'. How do you fix it?
Show answer
Frequently asked questions
How important is Linux and Shell Scripting in DevOps interviews?
Linux runs almost every server and container in production, so it is the base of all DevOps work. This topic covers file permissions, processes, systemd services, logs, networking commands and bash scripting with cron, plus the troubleshooting questions interviewers love: full disks, high CPU, OOM kills and SSH failures.
How should I use the Linux and Shell Scripting sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.
