An exhaustive, categorized compilation of real-world Linux interview and college viva questions covering Architecture, Commands, File Systems, Permissions, Processes, LVM, Networking, Security, and Troubleshooting.
Whether you are a BCA, MCA, or Computer Science student preparing for your university viva voce, or a practicing engineer preparing for Red Hat Certified System Administrator (RHCSA), LFCS, or cloud DevOps job interviews, technical mastery of Linux internals is essential.
Below is our curated master handbook of real-world Linux questions divided into eight specialized categories. Click on each question to reveal its in-depth explanation and command demonstrations.
.ko extension) that can be dynamically loaded into and unloaded from kernel memory at runtime without rebooting the system or recompiling the kernel. Common tools include lsmod (list loaded modules), modinfo, modprobe (loads module with dependency resolution), and rmmod.
free -h, swapon --show, and tune kernel swapping aggressiveness via /proc/sys/vm/swappiness (0 to 100).
No space left on device error when creating any new file, even though df -h shows ample free gigabytes. You detect this using df -i.
ln -s) is an independent file with its own inode that stores the text path of the target. If the target file is deleted or renamed, the symlink becomes a broken / dangling pointer. Symlinks can cross partition boundaries and link to directories.
open, read, write, close) to user-space applications regardless of the underlying storage format. VFS transparently routes calls to concrete drivers (ext4, XFS, Btrfs, NFS, ISO9660, /proc).
grep searches text using Basic Regular Expressions (BRE). egrep (or grep -E) supports Extended Regular Expressions (ERE) without requiring backslashes for special characters like +, ?, |, and (). fgrep (or grep -F) searches for fixed string literals without evaluating any regular expression syntax, making it significantly faster for massive log searches.
sudo find /var/log -type f -mtime +30 -exec rm -f {} +
# Or using the native -delete flag:
sudo find /var/log -type f -name "*.log" -mtime +30 -delete
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -n 10
0 (stdin), 1 (stdout), and 2 (stderr). To redirect standard output to a file, use > file.txt or 1> file.txt. To redirect errors only, use 2> errors.log. To redirect both streams into a single log file, use &> all_output.log or > log.txt 2>&1.
john:x:1001:1001:John Doe,IT Dept:/home/john:/bin/bashjohn)x (encrypted hash stored securely in /etc/shadow)1001)1001)/home/john)/bin/bash).
umask (User File-Creation Mode Mask) defines permissions automatically subtracted from default maximums when creating files (default max 666) or directories (default max 777). With a umask of 022:rw-r--r--)rwxr-xr-x).
1000, represented as t at the end of permissions: drwxrwxrwt) ensures that within a world-writable directory (like /tmp), only the file's owner or root can delete, rename, or modify that file. Without the sticky bit, any user could delete another user's files inside /tmp.
/usr/bin/passwd) is run by an unprivileged user, it executes with the privileges of the file owner (root), allowing users to update their own password hash in /etc/shadow.systemd (PID 1) and continue executing normally until completion.Z in ps) is a process that has finished execution via exit(), but its parent has not yet executed the wait() system call to read its exit status code. A zombie consumes no memory or CPU, but it occupies an entry in the system process table.
-20 (highest priority, least nice to other processes) to +19 (lowest priority, very nice to others). Default priority is 0. Regular users can only increase their process's niceness (lowering priority); only root can assign negative values to boost CPU scheduling priority via the CFS (Completely Fair Scheduler).
D represents a process blocked waiting for hardware or network I/O (such as waiting for a disk block from an unresponsive NFS server). The kernel puts the process in an uninterruptible sleep state to prevent filesystem corruption. A process in D state cannot be killed even by kill -9; it only clears once the I/O completes or the server is rebooted.
pvcreate /dev/sdb1.vgcreate vg_data /dev/sdb1 /dev/sdc1.lvcreate -L 50G -n lv_web vg_data, formatted with a filesystem and mounted like standard disks.
# 1. Extend the Logical Volume size by 20GB and resize ext4 filesystem automatically:
sudo lvextend -L +20G /dev/vg_data/lv_web -r
# 2. For XFS filesystems (if -r was omitted):
sudo xfs_growfs /mnt/web
ifconfig belongs to the legacy 1990s net-tools package. It uses outdated ioctl system calls, cannot handle policy routing, network namespaces, multiple IP aliases per interface natively, or modern IPv6 configurations correctly. iproute2 (the ip suite) communicates directly with kernel Netlink sockets and provides unified link, address, and routing management.
SYN_SENT.SYN_RECV.ESTABLISHED. Full-duplex data transfer begins.
systemctl restart stops the daemon completely (killing child worker processes and severing active client TCP connections) and spawns a fresh process. systemctl reload sends a SIGHUP signal instructing the running daemon (like Nginx) to re-read its configuration files on disk without terminating worker processes or dropping active user sessions (zero-downtime configuration reload).
linux and append rd.break (RHEL) or init=/bin/bash (Ubuntu/Debian) to the end.mount -o remount,rw /sysroot (or /).chroot /sysroot.passwd root.touch /.autorelabel and reboot.