Linux Interview Questions and Answer (original) (raw)

Last Updated : 4 Feb, 2026

Linux is a core skill in the IT industry and is widely used in system administration, cloud platforms, DevOps, and cybersecurity. As professionals gain experience and hands-on expertise, they progress from entry-level operational roles to senior and architect-level positions.

Linux career roles can be broadly categorized into three experience levels: freshers (0–2 years), professionals with 2–5 years of experience, and experts with 5+ years of experience, reflecting growth from basic operational roles to advanced and leadership positions.

Entry-Level Linux Professionals (0–2 Years Experience)

Professionals who have studied Linux usually begin with entry-level roles focused on system monitoring, basic administration, and troubleshooting. These roles help build strong fundamentals in Linux, networking, and server operations while working under senior guidance.

Below are the interview questions that will help you crack interviews for the above entry-level Linux professional roles.

1. How do you check the Linux kernel and operating system version?

2. How do you list all files including hidden files?

ls -la

Hidden files usually store application or user configuration and begin with a dot (.).

3. How do you view a large file efficiently?

Instead of opening the entire file, use:

This avoids performance issues with large logs.

4. A log file is updating continuously. How do you monitor it?

tail -f /var/log/syslog

This is commonly used in production environments to monitor live system or application logs.

5. How do you search for a specific word inside a file?

grep "error" filename

grep is widely used for identifying errors or patterns in log files.

6. How do you search for a word recursively in multiple files?

grep -Ri "error" /var/log/

This helps in system-wide troubleshooting when the error source is unknown.

7. How do you find a file by name in Linux?

Files can be located using:

8. How do you check disk usage on a Linux system?

These commands are essential for diagnosing disk space issues.

9. A filesystem is full. What steps do you follow to identify the cause?

10. How do you check memory usage?

free -h

This command displays total, used, and available memory in a human-readable format.

11. A server is slow. Which command do you run first and why?

top

It provides real-time visibility into CPU, memory usage, and resource-consuming processes.

12. How do you view all running processes?

ps aux

This command lists all processes along with their resource usage.

13. How do you terminate a process in Linux?

Force kill should be used only when necessary.

14. How do you change file permissions?

chmod 755 filename

This grants full access to the owner and read/execute permissions to group and others.

15. How do you change file ownership?

chown user:group filename

This is often required when correcting access-related issues.

16. A user gets a “Permission denied” error. What do you check?

This error usually occurs when the user does not have the required access rights or when security policies restrict the operation.

17. How do you create a new user in Linux?

useradd username
passwd username

User creation is a common administrative task.

18. A user cannot log in. What possible reasons do you check?

19. How do you check system uptime and load average?

uptime

Load averages help determine whether the system is under heavy load.

20. How do you schedule a task to run automatically at specific times in Linux?

Recurring tasks in Linux are scheduled using cron by editing the crontab file:

crontab -e

You define the execution time and the command or script, which is commonly used for backups, log cleanup, and maintenance jobs.

21. How do you schedule a script to run every day at 1 AM?

You add an entry in the crontab using:

crontab -e

0 1 * * * /path/script.sh

This is commonly used for automated backups and maintenance tasks.

22. How do you check the IP address and network interfaces on a Linux system?

Use the following command:

ip addr

It displays all network interfaces along with their assigned IP addresses and status.

23. How do you test basic network connectivity from a Linux server?

These commands help distinguish network issues from application issues.

24. A web service is not accessible. What do you verify first?

This helps quickly isolate the root cause.

You create a symbolic link using:

ln -s source target

This allows multiple references to the same file or directory.

27. How do you view system and application logs in Linux?

Logs are typically located under /var/log and can be viewed using:

Logs are essential for troubleshooting system issues.

28. How do you view logs for a specific service?

**Use:

journalctl -u servicename

This command displays logs related only to the specified service, making debugging easier.

29. How do you check which ports are open and listening on a system?

**Run:

ss -tulpn

This command shows active listening ports along with the associated services and process IDs.

30. A service is running but still not accessible. What checks do you perform?

These checks help identify access or security-related issues.

Mid-Level Linux Professionals (2–5 Years Experience)

After gaining hands-on experience, professionals move into mid-level roles involving automation, cloud platforms, and production system management. At this stage, Linux skills are combined with DevOps practices, cloud technologies, security, and monitoring tools.

Below are the interview questions that will help you crack interviews for the above mid-level Linux professional roles.

31. How do you check why a service failed to start?

You should first check the service status and logs:

systemctl status servicename
journalctl -u servicename

These commands provide error messages and startup failure reasons.

32. How do you permanently mount a filesystem?

mount -a

This helps avoid boot-time failures.

33. What is LVM and why is it used in production?

34. How do you extend a logical volume and filesystem?

**Typical steps include:

Most modern filesystems support online resizing.

35. A server disk usage suddenly increased. How do you investigate?

36. How do you manage and control services in systemd?

Systemd services are managed using systemctl:

Systemd also supports dependency and restart policies.

37. How do you check which process is using a specific port?

ss -tulpn | grep PORT

This helps identify conflicts when services fail to start.

38. How do you configure a firewall on Linux?

Firewall configuration varies by Linux distribution:

**Example:

ufw allow 22
firewall-cmd --add-service=http --permanent

Firewalls are used to restrict unauthorized access and protect services.

39. A service is running but users cannot access it. What do you check?

40. What is SELinux and how do you check its status?

41. How do you temporarily and permanently change kernel parameters?

Kernel tuning is common in performance optimization.

42. How do you monitor CPU, memory, and I/O performance?

Common tools include:

43. How do you copy files securely between servers?

scp file user@server:/path

or

rsync -avz source/ user@server:/dest/

rsync is preferred for large or repeated transfers.

44. What is rsync and why is it better than scp?

45. How do you configure passwordless SSH access?

This improves security and automation.

46. How do you check scheduled cron jobs for a user?

crontab -l

System-wide cron jobs are located in /etc/cron.* directories.

47. A cron job is not running. What do you verify?

48. How do you rotate logs in Linux?

49. How do you identify zombie processes?

50. How do you troubleshoot high load average?

Load average alone does not always mean high CPU usage.

NFS is commonly used for shared storage.

52. How do you synchronize system time on Linux?

53. What is swap and when should it be used?

54. How do you add a swap file?

Steps include:

  1. Create file using fallocate
  2. Set permissions
  3. Format with mkswap
  4. Enable using swapon

55. How do you troubleshoot DNS resolution issues?

56. What is /proc filesystem used for?

57. How do you limit resource usage for a user or process?

Resource limits can be set using:

58. A system rebooted unexpectedly. How do you investigate?

59. How do you check which files are consuming the most space?

du -sh * | sort -h

This helps quickly locate disk space issues.

60. How do you ensure changes are not lost after reboot?

Senior & Expert Linux Professionals (5+ Years Experience)

With extensive experience, Linux professionals transition into advanced, architect, or leadership roles. These positions focus on system design, scalability, security architecture, and leading technical teams or enterprise platforms.

Below are the interview questions that will help you crack interviews for the above advanced Linux professional roles.

61. How do you design a highly available Linux-based application stack?

A highly available stack is designed by removing single points of failure at every layer.

This typically includes load balancers, multiple application nodes, replicated databases, health checks, and automated failover to ensure continuous service availability.

62. A production server suddenly becomes unreachable. What is your troubleshooting approach?

Firstly follow a layered approach, starting from the lowest level:

This approach helps isolate the issue quickly without assumptions.

63. How do you analyze a high load average on a Linux system?

64. How do you perform zero-downtime deployments on Linux servers?

65. How do you investigate kernel panic issues?

Kernel panic investigation involves collecting and analyzing crash data:

This helps identify hardware issues, driver bugs, or kernel-level failures.

66. How do you tune Linux for high network throughput?

67. How do you manage Linux systems at scale?

68. How do you identify and fix configuration drift?

69. A service works after restart but fails again later. How do you debug this?

This usually indicates a recurring underlying issue rather than a one-time failure:

Long-term monitoring and trend analysis are essential to identify the root cause.

70. Logs are growing rapidly and filling disk space. How do you fix this?

Firstly identify the source application and verify log rotation:

71. A server suddenly becomes slow during peak hours. How do you troubleshoot?

Start by checking real-time resource usage using:

top

72. Disk space on /var is 100% full. What steps do you take?

First, Identify what is consuming space:

df -h
cd /var && du -sh * | sort -h

I usually find logs or application dumps, then clean or rotate them safely without deleting critical files.

73. A service is running but users cannot access it. How do you debug?

Firstly verify in this order:

Only after OS-level checks do I move to application logs.

74. A Linux server reboots automatically at night. How do you investigate?

I first check previous boot logs:

journalctl -b -1

Then I review system logs for OOM kills, kernel panics, or scheduled reboots to identify the root cause.

75. A process is consuming high CPU continuously. How do you handle it?

I identify the process using:

top

Then I check whether it is expected behavior.
If not, I investigate logs or dependencies before restarting or limiting the process.

76. A cron job is not running as expected. What do you check?

I verify:

Most failures are due to environment differences in cron.

77. SSH login suddenly stops working for users. How do you troubleshoot?

I check:

78. A filesystem needs to be expanded without downtime. What do you do?

79. A service crashes after running for several hours. How is this issue debugged?

80. A system shows a high load average but low CPU usage. What does this indicate?

81. How do you troubleshoot performance issues without restarting services?

From the OS side, I verify:

Once OS health is confirmed, application and database teams are involved.

83. How do you design Linux systems for scalability?

84. How do you validate system changes before production rollout?

Changes are validated through:

This minimizes production risk.

85. How do you reduce blast radius during failures?

86. How do you manage on-call responsibilities effectively?

87. How do you investigate suspected security breaches?

88. How do you balance performance, cost, and reliability?

89. How do you mentor junior Linux engineers?

90. How do you stay updated with Linux and infrastructure changes?