PrepPilotPractise free

Linux interview questions

Boot, systemd, journalctl, df/du, memory, networking, performance

35 questions · $ bash · updated November 2026

Practise these as flashcards. One or two lines each; the ones you miss come back first.

Start free

Core questions

Walk me through the Linux boot process.

Firmware runs POST and hands off to GRUB. GRUB loads the kernel and initramfs. The kernel starts the hardware, mounts the real root filesystem and launches systemd as PID 1. systemd brings up the default target and its services.

A disk is 100% full. What do you do?

df -h to find the filesystem, then du -xsh /path/* | sort -h to find the biggest folder. It's usually logs: truncate or compress them, then fix logrotate so it doesn't come back. If du doesn't add up, a deleted file is still open. Find it with lsof +L1 and restart that process.

Difference between systemctl start and enable?

start runs the service now. enable makes it start at boot. enable --now does both.

What does chmod 755 mean?

Owner can read, write and execute. Group and others can read and execute. It's the normal mode for scripts and directories.

Difference between su and sudo?

su switches to another user and needs that user's password. sudo runs one command as root with your own password, is logged, and can be limited per command in sudoers.

How do you see the last hour of logs for one service, and follow it live?

journalctl -u <service> --since "1 hour ago", and journalctl -u <service> -f to follow. Add -p err for errors only, -b for this boot, -b -1 for the previous boot.

df vs du?

df reports used and free space per mounted filesystem, from the filesystem's own accounting. du adds up the sizes of files it can walk to. -h makes both human-readable. Use df -h to find which mount is full, then du -xh --max-depth=1 <mount> | sort -h to find what's filling it.

How do you find which process is listening on port 8080?

ss -tlnp | grep 8080 (or lsof -i :8080). It shows the process, PID and bind address. If it's bound to 127.0.0.1, only local clients can reach it.

What's the difference between /etc/passwd and /etc/shadow?

/etc/passwd is world-readable and holds username, UID, GID, home directory and shell. /etc/shadow is readable only by root and holds the password hashes and expiry settings.

Hard link vs symbolic link?

A hard link is another name for the same inode: same data, survives deleting the original, can't cross filesystems or point at directories. A symlink is a small file containing a path: can cross filesystems, but breaks if the target moves.

What does > file 2>&1 mean?

Send stdout (1) to the file, then send stderr (2) to wherever stdout is going, so both end up in the file. Order matters: 2>&1 > file sends stderr to the terminal.

How do you find files larger than 1 GB?

find / -xdev -type f -size +1G -exec ls -lh {} \;. -xdev keeps it on one filesystem so it doesn't crawl NFS mounts or /proc.

Intermediate questions

Load is high but CPU usage is low. What's happening?

See the answer in the app, free

What is a zombie process?

See the answer in the app, free

The app works on port 8080 locally but not from other servers. Why?

See the answer in the app, free

SSH says Permission denied (publickey). What do you check?

See the answer in the app, free

What is the OOM killer?

See the answer in the app, free

How do you add 20 GB to a VM's root filesystem?

See the answer in the app, free

The app works with SELinux permissive but fails in enforcing. Fix?

See the answer in the app, free

df says the disk is 100% full but du only adds up to 60%. Why?

See the answer in the app, free

'No space left on device' but df -h shows 40% free. Why?

See the answer in the app, free

free shows 200 MB free on a 16 GB server. Is that a problem?

See the answer in the app, free

The server rebooted overnight. How do you find out why on Linux?

See the answer in the app, free

journalctl shows nothing from before the reboot. Why?

See the answer in the app, free

A script works when you run it but fails from cron. Why?

See the answer in the app, free

An app logs 'Too many open files'. Fix?

See the answer in the app, free

How do you prove whether DNS is the problem for an app?

See the answer in the app, free

Give the one-liner for the top 10 client IPs in an Nginx access log.

See the answer in the app, free

What's the risk with /etc/fstab and how do you avoid it?

See the answer in the app, free

How do you find which process is causing heavy disk I/O?

See the answer in the app, free

Should production servers have swap? What is swappiness?

See the answer in the app, free

Senior questions

How would you patch 150 Linux machines safely?

See the answer in the app, free

A Linux server is 'slow'. Walk me through your first 60 seconds.

See the answer in the app, free

A process is stuck in D state and kill -9 doesn't work. What's going on?

See the answer in the app, free

How would you get logs from 500 servers into one place, and why?

See the answer in the app, free

More Infrastructure Engineering topics