LearnDevOpsHands-On Labs
Back to All Interview Tracks
26 QuestionsDevOps & Cloud

Linux Interview Questions

26 Linux questions from real DevOps and SRE interviews, sorted by seniority: permissions, processes and signals, systemd, networking utilities, disk space, and performance triage.

Processes & SignalsFile Permissions & ACLsSystemd ServicesNetwork DiagnosticsDisk & Inode TriageKernel Tunables
Showing 26 of 26 questions
•
#1

Explain what <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">chmod 644</code> and <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">chmod 755</code> actually mean.

Junior

Each digit is a three-bit field for one class of user: owner, group, other. Read is 4, write is 2, execute is 1.

644 is owner read and write, group read, other read. That is the normal mode for a file.

755 is owner read, write and execute, group read and execute, other read and execute. That is the normal mode for a directory or a script.

The part that shows understanding: on a directory, the bits mean something different. Read lets you list names, write lets you create and delete entries, and execute lets you traverse into it. A directory with read but not execute gives you the file names and nothing else, which is why 755 rather than 644 on directories is not arbitrary.

link
#2

What is the difference between a hard link and a symbolic link in Linux?

#3

How do you find which process is using a port in Linux?

#4

On Linux the disk is full but deleting files does not free space. Why?

#5

What is the difference between <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">&gt;</code> and <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">&gt;&gt;</code> in bash, and how do you redirect stderr?

#6

What is the difference between SIGTERM, SIGKILL and SIGHUP?

#7

A Linux server is slow. Walk me through diagnosing it.

#8

What do setuid, setgid and the sticky bit do in Linux?

#9

How do you investigate a systemd service that will not start?

#10

A Linux service cannot reach another host. How do you narrow it down?

#11

Using a shell pipeline, how would you find the ten IPs making the most requests in an access log?

#12

What is a zombie process in Linux, and is it a problem?

#13

What does an inode hold, and what does it not?

#14

What does systemd give you over an init script, and what are the trade-offs?

#15

What is Linux load average actually measuring, and how do you interpret it?

#16

How does the Linux OOM killer decide what to kill, and how do you investigate afterwards?

#17

What happens, step by step, when you <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">curl https://example.com</code> from a Linux host?

#18

Why does <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">set -euo pipefail</code> matter in a bash script, and where does it still not protect you?

#19

How would you find what is consuming disk space on a full Linux server?

#20

What is the difference between a hard and soft ulimit, and when does it bite?

#21

What is the difference between <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">$?</code>, <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">$$</code> and <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">$!</code> in bash?

#22

How do you read journalctl logs for a service that has already restarted several times?

#23

How do you give a Linux user one privileged capability without giving them root?

#24

What is the difference between <code class="rounded-none bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] text-slate-900">/etc/hosts</code>, DNS and nsswitch on Linux?

#25

On a Linux server, requests are intermittently slow but CPU, memory and disk all look fine. Where do you look?

#26

How do you grep for a string across a directory tree in Linux, excluding some files?