Preparing for a Linux Administration interview? This comprehensive guide features 30 essential questions with detailed answers, progressing from basic to advanced levels. Ideal for freshers, candidates with 1-3 years, and 3-6 years of experience preparing for roles at companies like Zoho, Atlassian, or Paytm.
Basic Linux Administration Interview Questions
1. What is the name and UID of the administrator user in Linux?
The administrator user is named root with UID 0, which provides full system access.[1][2]
2. How do you list all files including hidden ones in a directory?
Use ls -la to display all files, including hidden files starting with a dot (.).[2][3]
3. What command shows free and used memory in Linux?
The free -h command displays memory usage in human-readable format. Free memory does exist in Linux as cached or buffers.[2]
4. How do you check the Linux kernel and operating system version?
Use uname -r for kernel version and cat /etc/os-release for OS distribution details.[3]
5. What is the purpose of the /etc/passwd file?
The /etc/passwd file stores user account information including username, UID, GID, home directory, and default shell.[7]
6. How do you create a new user account in Linux?
Use useradd -m username to create a user with home directory, then set password with passwd username.[6]
7. What does CTRL+C do in a Linux terminal?
CTRL+C sends SIGINT signal to terminate the foreground process running in the terminal.[2]
8. How do you switch to another user account without password?
Use su - username as root or sudo -i to become root.[6]
9. What command displays the current directory?
The pwd command prints the working directory path.[2]
10. How do you update user password securely?
Use passwd username which prompts for new password and encrypts it in /etc/shadow.[6]
Intermediate Linux Administration Interview Questions
11. What is the difference between rm and rmdir?
rm removes files or directories recursively with -r, while rmdir only removes empty directories.[2]
12. How do you find which process is using a specific port?
Use netstat -tulpn | grep :port or ss -tulpn | grep :port to identify the PID.[1]
13. Explain the umask command and how it works.
umask sets default permissions by subtracting from 666 (files) or 777 (directories). Default umask 022 creates 644/755 permissions.[1]
14. How would you permanently set umask for a specific user?
Add umask 022 to the user’s shell profile file like ~/.bashrc or /etc/profile based on their default shell.[1]
15. What are the three load averages in Linux and how to view them?
Load averages (from uptime or top) show system load for 1, 5, and 15 minutes. Values above CPU cores indicate overload.[2]
16. How do you check memory and CPU statistics in real-time?
Use top or htop for interactive monitoring of CPU, memory, and process usage.[1]
17. What is the filesystem hierarchy standard in Linux?
/ (root), /bin (binaries), /etc (config), /home (users), /var (logs/variable), /usr (user programs), /tmp (temporary).[2]
18. How do you redirect both STDOUT and STDERR to /dev/null?
Use command > /dev/null 2>&1 to discard both standard output and error output.[2]
19. What command creates an ext4 filesystem on a partition?
First create partition with fdisk, then mkfs.ext4 /dev/sdX1 formats it as ext4.[1]
20. How do you lock a user account temporarily?
Use usermod -L username or passwd -l username to lock the account password.[6]
Advanced Linux Administration Interview Questions
21. What are Logical Volume Manager (LVM) advantages?
LVM allows dynamic resizing of partitions, snapshots, and spanning volumes across disks without downtime.[1]
22. How do you extend an LVM logical volume?
lvextend -L +5G /dev/vgname/lvname
resize2fs /dev/vgname/lvname
[1]
23. Where are kernel modules located in Linux?
Kernel modules are stored in /lib/modules/$(uname -r)/ directory.[1]
24. What are the different Linux network bonding modes?
Mode 0 (balance-rr), Mode 1 (active-backup), Mode 4 (802.3ad LACP), Mode 5 (balance-tlb) for redundancy and load balancing.[1]
25. How do you troubleshoot a “device busy” error when unmounting?
Use lsof /mountpoint or fuser -m /mountpoint to find PIDs using the mount, then kill them.[2]
26. What is a chroot jail and how do you create one?
chroot jail restricts process to a specific directory. Create with chroot /path/to/jail /bin/bash.[2]
27. Explain cgroups and a usage scenario.
cgroups (control groups) limit resource usage per process group. Use to cap CPU/memory for database processes.[2]
28. How do you change process priority in Linux?
Use renice -n 10 -p PID to adjust nice value (higher = lower priority). Use chrt for real-time scheduling.[2]
29. Where are SAR logs stored and what do they monitor?
SAR (System Activity Reporter) logs in /var/log/sa/ or /var/log/sysstat/. Monitors CPU, memory, I/O, network over time.[1]
30. How would you share a directory using NFS?
# Server: Edit /etc/exports: /share *(rw,sync)
exportfs -ra
systemctl restart nfs-server
# Client: mount -t nfs server:/share /mnt
[1]
## Related Linux Administration Topics