Linux knowledge is expected for system administration, DevOps, cloud and security jobs. These Linux interview questions cover the fundamentals that interviewers ask freshers and junior engineers, with short answers and commands. For scenario-based questions, see our Linux system administrator interview questions.

Linux interview questions

Basics

1. What is Linux?

Linux is a free, open-source, Unix-like operating system kernel created by Linus Torvalds in 1991. Combined with GNU tools and other software, it forms distributions such as Ubuntu, Debian, RHEL and Fedora.

2. Kernel vs shell?

The kernel manages hardware, memory and processes. The shell, such as Bash, is a program that reads your commands and asks the kernel to run them.

3. What is a distribution?

A distribution packages the Linux kernel with tools, a package manager, default settings and support. Server favourites include Ubuntu Server, Debian and RHEL-compatible systems like Rocky Linux and AlmaLinux.

Files and permissions

4. Describe the Linux directory structure.

Everything starts at /. Important directories include /etc (configuration), /home (user files), /var (logs and changing data), /tmp (temporary files), /usr (programs and libraries) and /boot (kernel and bootloader).

5. How do Linux permissions work?

Each file has read, write and execute permissions for the owner, group and others. For example, chmod 640 file gives the owner read and write, the group read and others nothing. See Linux file permissions.

6. What is an inode?

An inode stores a file’s metadata: owner, permissions, size, timestamps and the location of its data blocks. It does not store the file name; directories map names to inode numbers. Use ls -i to see inode numbers.

7. Hard link vs soft link?

A hard link is another name pointing to the same inode. It cannot cross file systems or point to directories. A soft (symbolic) link is a separate file that points to a path; it breaks if the target is deleted. Create one with ln -s target link.

8. What are SUID, SGID and the sticky bit?

Special permissions that change how programs run or how shared directories behave. Read Linux special permissions.

Processes and services

9. How do you view and stop processes?

Use ps aux, top or htop to view them, and kill PID to stop one. kill -9 forces termination, but use it only when a normal kill fails.

10. What is a zombie process?

A process that has finished but whose parent has not collected its exit status. It uses no CPU, but many zombies indicate a buggy parent.

11. How do you manage services?

With systemd: systemctl status nginx, systemctl restart nginx and systemctl enable nginx. View logs with journalctl -u nginx.

Disks and users

12. How do you check disk and memory usage?

df -h shows free space per file system, du -sh dir shows a directory’s size and free -h shows memory and swap.

13. What is swap?

Disk space used when RAM is full. See how to create swap.

14. Which files store user and group data?

/etc/passwd, /etc/shadow (password hashes) and /etc/group. See user and group management.

Networking and logs

15. How do you check IP addresses and routes?

ip addr shows addresses, and ip route shows the routing table, including the default route. Older systems used ifconfig and route -n.

16. How do you check listening ports?

ss -tulpn lists TCP and UDP listening sockets with the owning processes.

17. Where are logs stored?

Traditionally in /var/log, for example /var/log/syslog or /var/log/messages and authentication logs in auth.log or secure. On systemd systems, use journalctl.

18. How do you find text in files?

grep -rin "error" /var/log searches recursively, ignoring case and showing line numbers.

Test yourself with our Linux quiz.

Keep preparing

Practise each answer out loud, and run the commands in a lab rather than memorising them. Interviewers often ask follow-up questions, so make sure you understand why each answer is true.

Sources

Preparing for an interview? Browse more questions in our interview preparation hub. For businesses, we also offer security services such as VAPT, server hardening and ISO 27001 readiness.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

This Post Has 3 Comments

Leave a Reply