Top 20+ Linux Interview Questions and Answers

Linux Interview Questions and answers

Looking to ace your Linux interview? This guide provides common Linux interview questions and answers for experienced as well as for Freshers to help you prepare.  Linux is an open-source platform that has contributed to world-changing ideas. It is an Operating System popular for its efficiency and fast performance. Linux forms the basis of a successful tech career.

From networking to cybersecurity to cloud computing, Linux is used almost everywhere. From web developers to Network Engineers, everyone needs to know about Linux. This creates a massive demand for Linux experts in the industry.

If you are eyeing becoming a Linux Administrator or any other tech professional, Linux certification is the right path for you to begin with. In this blog, we have collected the most frequently asked Linux interview questions and answers.

Here, we have classified questions in the following sections:

  • Linux Interview Questions for Beginners
  • Linux Commands
  • Linux Networking Interview Questions

Let’s begin!

Linux Interview Questions and Answers for Beginners

1. What is Linux?

  • Linux is an Operating System that is popular for its efficiency and fast performance. 
  • It is based on Linux Kernel which is low-level system software that is used to manage hardware resources for users.
  • It is a Unix-like open-source Operating System that can be run on different hardware platforms.
  • It directly managed the hardware and resources of a system such as CPU, memory, and storage.
  • It also manages communication between software and hardware.
  • It can be installed on laptops, mobiles, computers, etc.
  • Some of the flavors of Linux OS are Ubuntu, SUSE Linux, Gentoo, Debian, etc.

2. What is Linux Kernel?

  • Linux Kernel is the core of the Operating System.
  • It is a bridge between software and hardware.
  • It is low-level system software that is used to manage hardware resources for users.
  • Kernel contacts the hardware to seek permissions.
  • Most Android phones have Linux kernels.

3. What are the features of the Linux OS?

The following are the most important features of the Linux OS:

  • Free and Open-Source:  Linux is available for free for community use. Anyone can use it.
  • Adaptable and flexible: Linux can operate for long periods without crashing and is safe. It is not affected by security threats.
  • More secure: Linux is more secure as it gives security using authentication features like password authentication, security auditing and file system access control.
  • Application Support: Linux has its own software repository. It means it has a place or storage location from where software can be extracted for users to download and install applications.
  • Multiprogramming System: On Linux, more than one application can run at the same time.
  • Supporters customized keywords: Linux supports the installation of multiple language keyboards.
  • GUI (Graphic User Interface): Linux is user-friendly. It provides an interface to interact with the system. It allows you to use GUI applications such as VLC, Firefox, etc.

4. What are the basic elements or components of Linux?

Linux is made up of five basic elements or components as mentioned below:

  • Kernel: The kernel is the heart or the main part of Linux. It is responsible for all the main activities of OS such as process management, device management, etc.
  • System Library: These are special programs/functions which allow application programs/system utilities to access features of the kernel without any code. 
  • System Utility: These are utility programs responsible to perform specialized and individual-level tasks. They allow users to manage the computer.
  • Hardware: It is the physical hardware. It includes items such as a mouse, keyboard, CPU, display, etc.
  • Shell: It is an environment where we can run our commands, shell scripts and programs. It is the interface between the user and kernel. It is used to execute commands.

5. What is meant by BASH?

  • BASH (Bourne Again Shell) is a Unix shell and command processor.
  • It is basically a command language interpreter.
  • It was written by Brian Fox for GNU OS.
  • It can be used instead of Bourne Shell and is free software.
  • It includes some additional features such as command-line editing that make it easier to use.
  • It is an interpreted and not a compiled process.
  • It can be run in the terminal window.
  • BASH can read commands from shell scripts.
  • It allows users to write commands and execute them.

6. What is LILO?

  • LILO (Linux Loader) is a bootloader for Linux.
  • It is used to load Linux into memory and start the OS.
  • It is also a boot manager that allows a dual boot of a computer.
  • Most Linux OS use LILO to boot the operating system into main memory to start operations.
  • It can act as a master boot program or secondary boot program.
  • It can perform various functions such as locating the kernel, identifying other supporting programs, loading memory and starting the kernel.
  • To install Linux OS, it is the best practice to install a special bootloader like LILO as it allows a fast boot of Linux OS.

7. What are the Process States in Linux?

Linux process could be found in many different states. The process enters these states from the beginning till the very end. 

Process states in Linux are given below:

  • New/Ready: A new process is created in this state and is ready to run.
  • Running: The process is executed in this state.
  • Blocked/Wait: The process waits for input from the user in this state. If it does not have resources to run such as memory, file locks, input, then it remains in a blocked or waiting state.
  • Terminated/Completed: The process completes the execution or termination by the OS in this state.
  • Zombie: The process is terminated but information related to the process is kept. This information is available in the process table in the zombie state.

Linux Commands Interview Questions

8. What are the Linux Directory commands?

The Linux directory commands are given as follows:

  • pwd: It is a built-in Linux command. It stands for ‘print working directory’. It tells the current working location, and working path starting with a / and directory of the user. In other words, it shows the full path to the directory the current user is in.
  • is: The is command lists out all the files in the directed folder.
  • cd: The cd command stands for ‘change directory’. It is used to change to the directory you want to work from the present directory. To access a particular directory, you can simply type cd followed by the directory name.
  • mkdir: The mkdir command is used to create a completely new directory.
  • rmdir: The rmdir command is used to remove a directory from the system.

9. How to open a command prompt when issuing a command?

Launch your terminal by pressing CTRL+ALT+T or by giving terminal in the menu search bar.

10. How to find out how much memory is Linux using?

You can find it out through a command shell. You can use the “concatenate” command: cat /proc/ meminfo for memory usage information.

11. What is netstat command?

  • The netstat (Network Statics) command is a networking tool used for troubleshooting and configuration.
  • It is used to show all network connections on a system.
  • Through netstat command, you can check whether the various aspects of TCP/IP are working and what connections are present.

12. How to check the default route and routing table?

You can use the following commands to display the default route and routing table:

$ route-n

$ nestat-rn

$ ip

13. How can you change the default run level in Linux?

You can change the default run level in Linux by using the init command.

14. What do you understand by the ping command?

  • Linux ping (Packet Internet Groper) command is used to check connection status between source and destination.
  • In other words, this command checks two things: if a network is available or not, if the host is reachable or not.
  • It can also be used to troubleshoot different connectivity issues, and verify connectivity at an IP-level to a second TCP/IP device.
  • You can use this command to test both the computer name and the IP address of the computer.

15. Which command can be used to count the number of characters in a file?

You can use the “wc” Linux command to count the number of characters in a file. The command “wc” stands for word count. This command is used to count the number of lines, words and characters in a text file.

16. What is meant by unmask?

Also known as user file-creation mask, unmask is a Linux command that allows you to set up default permissions for new files and folders that you create. In Linux OS, unmask command is used to set up default file and folder permission. 

It is also used by other commands in Linux that create files and directories. These commands are mkdir, tee, touch, etc.

Linux Networking Interview Questions

17. What are the benefits of using NIC teaming?

NIC (Network Interface Card) teaming has various advantages as given below:

  • Load Balancing
  • Failover
  • Increases uptime

18. What are the various network bonding modes used in Linux?

The following are the various network bonding modes used in Linux:

  • Mode-0 (balance-rr): It is the default mode and works on round-robin policy. It has fault tolerance and load balancing.
  • Mode-1 (active-backup): It works on active-backup policy. Only one node works at the time of failure of other nodes.
  • Mode-2 (balance-xor): It sets an XOR (exclusove-or) mode for providing load balancing and fault tolerance.
  • Mode-3 (broadcast): It works on broadcast policy. It provides a broadcast mode that is fault-tolerant and can be used for specific purposes only.
  • Mode-4 (802.3ad): It is based on IEEE 802.3ad standard which is also called Dynamic Link Aggregation mode. It creates aggregation groups that have the same speed and duplex settings.
  • Mode-5 (balance-tlb): It is also known as Adaptive TLB (Transmit Load Balancing). It offers the TLB mode for fault tolerance and load balancing. Traffic will be loaded based on each slave of the network.
  • Mode-6 (balance-alb): It is also called Adaptive Load Balancing. It offers ALB mode for fault tolerance and load balancing. It does not need any special switch support.

19. What is SSH? How can you connect to a remote server through SSH?

  • SSH stands for Secure Shell. 
  • It is a protocol that is used to securely connect to remote servers or systems. 
  • It allows two system to communicate.
  • It is the most common way to have access to remote Linux servers.
  • It usually transmits data over encrypted channels.
  • Therefore, it has a high security.
  • You need yo own a domain name and IP address in order to connect to a remote server through SSH.

20. What are the three standard streams in Linux?

Standard streams are I/O (Input and Output) communication channels between a program and its environment in Linux. Input and output are distributed across three standard streams in the Linux environment. 

Three standard streams in Linux are given below:

  • Standard Input (stdin)
  • Standard Output (stdout)
  • Standard Error (stderr)

21. Name the default ports used for DNS, SMTP, FTP, SSH, DHCP and squid.

Default ports that are used for different services are given below:

Service

Port

DNS

53

SMTP

25

FTP

20 (Data transfer), 21 (Connection established)

SSH

22

DHCP

67/UDP (dhcp server), 68/UDP (dhcp client)

Squid

3128

FAQs:

Linux is an Operating System that is popular for its efficiency and fast performance. It is based on Linux Kernel which is low-level system software that is used to manage hardware resources for users.

Since Linux is an open-source platform, anyone can run, study, change and redistribute the source code. Anyone can even sell copies of the modified code keeping in mind thst they sell under the same license.

Many devices work on Linux. These are android phones, cameras, watches, tablets, digital storage devices, Chromebooks, etc.

Linux is an open source Operating System which is made up of the kernel, base components of OS, tools, apps and services bundled along with it.

The following are the features of Linux:

  • Free and Open-Source
  • Adaptable and flexible
  • More secure
  • Application Support
  • Multiprogramming System
  • Supporters customized keywords
  • GUI (Graphic User Interface)

1 thought on “Top 20+ Linux Interview Questions and Answers”

  1. Great post! As a Linux professional, I found the interview questions and answers very helpful in preparing for my next interview. The questions cover a wide range of topics, from basic system configuration to advanced networking concepts. I especially appreciated the explanation of the “TCP/IP stack” in section 17, it was crystal clear. Thanks for sharing this valuable resource!

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.