A sample of real Linux interview questions with full answers and explanations - practice for interviews or certification exams.
Linux checks for the execute permission bit before it will run a file directly. Even if the script is readable and syntactically fine, without execute permission (chmod +x) the shell refuses to run it as a program. Ownership by root isn't required, any user with execute permission on a file they own can run it.
df -h only tells you about raw disk SPACE, it says nothing about inodes, the separate, limited pool of 'slots' a filesystem has for tracking individual files. A directory packed with huge numbers of tiny files can exhaust every available inode slot while the actual disk space sits mostly empty, and df -i is what reveals that specifically.
/proc/softirqs specifically breaks down how many times each type of software interrupt (like the ones networking cards generate) has fired, per CPU core. That per-core, per-type breakdown is exactly what you need to tune which CPUs handle NIC traffic, something /proc/interrupts can't give you since it only covers hardware IRQs.
Matching file sizes alone doesn't guarantee the CONTENTS are identical, corruption can happen without changing a file's size. A cryptographic checksum like sha256sum produces a unique fingerprint of the actual content, so comparing those fingerprints is the fast, reliable way to confirm two large files are truly byte-for-byte the same.
These sound similar but solve different problems: REUSEADDR just lets a NEW process bind to a port that's still lingering in TIME_WAIT from an old one that used it, while REUSEPORT lets MULTIPLE processes bind that exact same port AT THE SAME TIME, with the kernel spreading incoming connections across all of them, which is how you'd run several worker processes load-balancing one port.
Host key warnings exist specifically to protect you from man-in-the-middle attacks, so turning that checking off everywhere throws away the exact protection host keys provide. Pushing the correct, updated known_hosts entries out to everyone (or moving to CA-signed SSH certificates) fixes the warnings without giving up that protection.
df -h reports disk space usage per mounted filesystem in a human-readable format (KB, MB, GB) along with percentage used. du -sh measures the size of a specific directory's contents rather than whole filesystems, free -h shows memory usage, and top shows running processes, not disk space.
/proc/sys/net/ipv4/tcp_mem only stores the CONFIGURED thresholds (low, pressure, high), it's a setting, not a live reading. /proc/net/sockstat is the one that actually reports real-time, current socket statistics, including how much TCP memory is allocated right now, in pages.
A ulimit set interactively in a shell only affects processes started from that shell session, not services launched independently by systemd at boot or via systemctl. To raise the limit for a systemd managed service, you need to set LimitNOFILE= in that service's unit file (or a drop in override) and then reload systemd and restart the service. It's not about needing a reboot or a bigger number, the setting simply never reached the service in the first place.
600 breaks down as: owner gets read and write, and literally everyone else (group, other) gets nothing at all. SSH actually enforces this for private keys specifically, it will flat-out refuse to use a key file that's readable by anyone besides its owner.
Real scenario-based DevOps questions, hands-on practice, and clear explanations for every answer.