Linux Interview Questions and Answers

Last updated on Mar 08, 2022
  • Share
Linux Interview Questions

A genuinely free and open source operating system, Linux is one of the most liked operating systems. It was designed keeping in mind the Unix compatibility. Read our detailed Linux interview questions to know more about the features and commands of Linux. Usually, it is called as the clone of Unix. Linux was developed by Linus Torvalds. While working on the Unix OS, he felt the need to improve Unix, but the designers of Unix rejected his suggestions. Hence, he founded the Linux in 1991 as a kernel first, which was later launched as a full-fledged OS.

Most Frequently Asked Linux Interview Questions

Here in this article, we will be listing frequently asked Linux Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q21. Compare cron and anacron in Linux with an example?
Answer
S.no CRON ANACRON
1. It is a daemon that runs scheduled tasks It runs commands periodically, the frequency being defined in several days.
2. Example – updates, system backups Example – a backup script that is scheduled to run weekly or monthly.
3. Suitable for machines that are on 24x7 like servers Suitable for machines like laptops and desktops that are NOT on 24x7.
4. Runs as per defined schedules. Checks if any job has to be executed when the user turns on the power.
5. Default system crontab file is /etc/crontab Listed in /etc/anacrontab
Q22. What is a daemon process in Linux?
Answer

A program that gets executed in the background because of the occurrence of a specific event, process or condition. Daemon processes are managed by the Kernel. The operations are given unique PIDs.

Q23. What is the difference between filesystems ext2, ext3 and ext4 in Linux?
Answer
1. ext2 Second extended filesystem.
2. ext3 The concept of journaling was introduced, wherein, if a system crash or power failure occurred, the filesystems that were not saved could be recovered, unlike ext2.
3. ext4 Performance improvements over the ext3 filesystem. Supports huge filesizes.
Q24. List 10 networking and troubleshooting commands in Linux?
Answer
  • Ifconfig – configure interface parameters of the network.
  • dig – performs DNS lookups to display a result obtained from name servers.
  • traceroute – prints the route that the packets take to the network host.
  • nslookup – queries internet domain name servers.
  • telnet – connect destination port if the connection between hosts is working fine
  • netstat – reviews each network connection and the open sockets.
  • w – writes (prints) current activities and processes by each user.
  • scp – secure copy the files from and to another host in the network.
  • ifup/ifdown – enable or disable the network interface respectively.
  • nmap – checks for the opened port on the server
Q25. How to give permission to full permission in Linux?
Answer

Use chmod 777 to give full permission to reading, write and execute.

Q26. list the different modes of using vi editor in Linux?
Answer

There are three modes – command mode, insert mode and last line or escape mode.

Q27. How to Uninstall Software with the Command Line in Linux?
Answer

Use the command apt-get as –

        apt-get --purge remove [filename]

Q28. What are system calls in Linux?
Answer

There are 80 system calls in Unix that are used to control processes, manage filesystem and for inter-process communication. System calls occur in the kernel.

Q29. Which command in Linux is used for the description of any command?
Answer

For this access the individual command’s manual page. For instance, to know the description of

     cat command, type

man cat

This will display a description of the said command.

Q30. How many types of bond are there in Linux?
Answer

There are 7 types of network bond in Linux – mode=0 (balance-rr), mode-1 (active-backup),

       mode=2 (balance-xor), mode=3 (broadcast), mode=4 (802.3ad), mode=5 (balance-tlb),

       mode=6 (balance-alb)

There are 3 main components in Linux
  • Kernel, which communicates with the users and the underlying hardware;
  • System library, which is a collection of functions and programs that contain almost all the functionalities of an operating system. Users can access the kernel’s features using these library functions;
  • System utility, which is a set of programs that do individual, specialized tasks

Check out all the Linux interview questions to understand how Linux is a more improved version of Unix.

Advantages of Linux
  • Linux is open source. Hence there are several distributions available to the end user. Example – Ubuntu, Mint.
  • By making the code available to everyone, security issues are caught by experts before the versions are released to the public, hence offering higher security.
  • Linux can be installed on any hardware without any hassle.
  • Highly customizable and flexible because of the availability of source code.
  • Provides good networking support using many commands. (Read more about this in our set of Linux interview questions)
  • Has good support and documentation.
Latest version

The latest version of Linux is Debian 9.3 released on December 9, 2017.

Reviewed and verified by Best Interview Question
Best Interview Question

With our 10+ experience in PHP, MySQL, React, Python & more our technical consulting firm has received the privilege of working with top projects, 100 and still counting. Our team of 25+ is skilled in...