Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Easy Level Linux Interview Questions
3.
Medium-Level Linux Interview Questions
4.
Hard-Level Linux Interview Questions
5.
Frequently Asked Questions
5.1.
Explain about Linux terminal.
5.2.
Why is Linux better?
5.3.
What are the disadvantages of Linux?
6.
Conclusion
Last Updated: May 28, 2024
Medium

Linux Interview Questions

Author Sinki Kumari
0 upvote

Introduction

Hello Ninjas, Are you looking for technical job roles?  If yes, then you are at the correct place. In this article, we will discuss Linux interview questions. 

Linux is an open-source computer operating system based on the Unix operating system (OS). It oversees the hardware and resources of a system, including the CPU, memory, and storage, as well as software and hardware communication. It's based on the Linux kernel and is free to download and use.

It can also be installed on mobile phones, laptops, desktops, notebooks, and other devices. Ubuntu, Debian, SUSE Linux, Gentoo, and different Linux OS flavours are available. 

Linux Interview Questions.

Easy Level Linux Interview Questions

Question 1: Define Linux. 

Answer: Linux is the most widely used open-source operating system. It is a UNIX-based operating system. It can support almost every computer platform, including ARM and SPARC. It directly manages the resources and hardware of a system, which include memory, CPU, and storage. Linux also handles the communication between software and hardware. 


Question 2: Explain the features of Linux.

Answer: There are several  features of linux operating system. Some of them are:

  • Linux is free and open source.
     
  • It is more secure.
     
  • It is robust and adaptable.
     
  • It is a multiprogramming system. This means that Linux allows more than one program to run at the same time.


Question 3: What are the components of Linux?

Answer: The components of Linux are as follows. 

  • Kernel: The kernel consists of various modules which interact directly with the hardware. It is a core part of Linux.
     
  • System Utility: They are responsible to do specialized and individual-level tasks.
     
  • System Library: Using these libraries, we can implement the operating system's functionalities.
     
  • Hardware: It includes a mouse, keyboard, display, and CPU.
     
  • Shell: Shell is an environment where we can run programs and commands.


Question 4: What do you mean by redirection?

Answer: Redirection in the Linux operating system allows to change the standard input and output devices. We can redirect the programs or files to specified locations asked by the user. For redirections, Metacharacters are used. 


Question 5: What is the use of Swap space in Linux?

Answer: In Linux, Swap space is used when the RAM is full. It may be considered as a physical memory substitute. The main function of swap space is to substitute disk space for RAM memory. Basically, swap space is nothing but an extension of RAM.


Question 6: What do you mean by LILO?

Answer: LILO is an abbreviation for Linux Loader. It is used to load Linux into memory and start our operating system. It is also called a boot manager, which facilitates a dual boot of a computer system.


Question 7: Define samba.

Answer: Samba is nothing but open-source software. It can run many operating systems, including IBM and OpenVMS. Samba connects Linux machines to Microsoft network resources by providing SMB support. Samba is stable and secure.


Question 8: To check memory status, which command is used?

Answer: “free” is the most used command to check the memory status in Linux. Other than the “free” command. “Cat,” “vmstat,” “top” and “htop” commands are used to check the memory status.


Question 9: What is the use of run-level command?

Answer: After boot, the run-level command is helpful in defining the state of the machine. By default, the run level of the system is set by the system administrator. 


Question 10: What do you mean by Grep command?

Answer: Grep command in Linux is a filter for the global search for Regular Expressions. This command is used to search the text in the given files and Strings. Grep is the most common command which is used in Linux.


Moving forward, let’s discuss medium-level Linux interview questions.

Click on the following link to read further: Javascript Interview Questions and Answers

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Medium-Level Linux Interview Questions

Question 1: Define the Zombie process.

Answer: Zombie process in Linux, refers to the process that is removed  from the user system but still resides in the processor’s memory. The child process always first becomes a zombie before being deleted from the process table.


Question 2: What types of file permissions are there in Linux?

Answer: There are mainly three types of permissions in the Linux operating system:

  • READ: By using READ permission, the user can read the file.
     
  • WRITE: By using WRITE permission, the user can write a new file.
     
  • EXECUTE: By using EXECUTE permission, the user can access and run the file.


Question 3: Define Shell Script.

Answer: In the Linux operating system, a Shell script is a script or programming language which is written for the shell. This script is used to control the applications. It allows the executions of different commands that enters in the shell. It helps to create programs to perform various tasks.


Question 4: Define Linux Kernel.

Answer: Kernel is low-level software for computer systems. The kernel is a main component of the Linux operating system. It acts as a bridge between hardware and software. Whenever a computer system starts, the kernel is the first program that is loaded. The main function are:

  • Memory management
     
  • Device management
     
  • Storage management
     
  • Process management


Question 5: What are some common Linux variants?

Answer: The Linux variants are as follows:

  • CentOS
     
  • Fedora
     
  • Debian
     
  • RedHat
     
  • Ubuntu


Question 6: Write the command for user management.

Answer: The basic commands for user management are given below:

  • last: This command is used to check the last logged-in user.
     
  • chage: This command is used to view and change the user password.
     
  • useradd: This command is used to create a new user account.
     
  • userdel: This command is used to delete the user account.
     
  • chown: This command is used to change the owner of the file.
     
  • newusers: This command is used to read a file.
     
  • chsh: This command is used to change the login shell of the username.


Question 7: What are some advantages of open source?

Answer: There are many advantages of open-source. A few of them are as follows.

  • Open source makes codes available to users for free.
     
  • It allows users to add new features, debug, and correct errors in the source code.
     
  • It provides users with great security.


Question 8: Explain BASH.

Answer: BASH in the Linux operating system is a Unix shell and command processor. This software is free and acts as a Bourne shell replacement. Bash provides a user interface to interact with operating system. BASH allows users to write commands. It can also read commands from shell scripts.


Question 9: What do you know about inode and process id?

Answer: In Linux, an inode is a data structure. It carries the file information. Each and every file is given a unique name that is inode, whereas each process is provided with a unique process id.


Question 10: What do you know about Virtual Desktops?

Answer: Virtual desktop in the Linux operating system is a user interface. Whenever we face any issue on our systems regarding how to manage multiple windows, at that time virtual desktop serves as an alternative. Virtual desktops allow us to use one or more program on a clean slate as it stores remote servers.


Moving forward, let’s discuss hard-level Linux interview questions.

Hard-Level Linux Interview Questions

Question 1: Differentiate between Hard and Soft links.

Answer: The difference between Hard and Soft Links are as follows.

Hard LinksSoft Links
Hard links are the mirror copy of the original file.Soft links are the symbolic link to the original file.
It contains the original contents of the file. It contains the location of the original file.
It is not used for linking directories.It is used for linking directories.


Question 2: What is Anacron and Cron?

Answer: Anacron: It is a type of program that is used to execute tasks. The tasks are executed at certain intervals. Anacron works more effectively if the machines are powered off in a day or week. It can only be used by super users, and it does not expect the system to run 24x7.

Cron: It is a program that is used to execute tasks. The tasks execute at a scheduled time. Cron work effectively if the machines run continuously. It can be scheduled by a normal user and expects the system to run 24x7.


Question 3: Differentiate between UNIX and LINUX.

Answer: The difference between UNIX and LINUX are as follows.

UNIXLINUX
UNIX is used is workstations and servers.LINUX is used in smartphones, desktops and so on..
BASH is the default shell of UNIX.BOURNE SHELL is the default shell of LINUX.
Unix is only available in English language.Linux is available in multiple languages.
Some examples are, Darwin, Solaris, and so on.Some examples are Red Hat, Ubuntu, and so on.


Question 4: Define GUI.

Answer: GUI is an abbreviation for Graphical User Interface. GUI is a human-computer interface. It allows us to interact with electronic devices, and this will happen through graphical icons and visual indicators. With the help of graphical elements or icons, it is easy to interact with the system for users. GUI is a combination of textual and graphical interaction. It uses message boxes, buttons, and menus.


Question 5: What are the commands used to check the memory status?

Answer: In Linux, we can check the status of memory by using the following commands:

  • free -m is used to display output in MB(Megabytes).
     
  • free -g is used to display output in GB(Gigabytes).
     

Question 6: Differentiate between BASH and DOS.

Answer: The difference between BASH and DOS are given below:

BASHDOS
BASH stands for Bourne Again Shell.DOS stands for Disk Operating System.
BASH follows conventional naming.DOS does not follow conventional naming.
It includes case-sensitive commandsIt includes case-insensitive commands

Also see, pwd command in linux

Question 7: Write the various process states in Linux.

Answer: The process states in Linux can be in many different states. Different process states are as follows:

  • New/Ready: This is a state where a new process is created and also ready for the run.
     
  • Running: This is a state where execution takes place.
     
  • Blocked/wait: This is a state where the process waits for the user to provide input.
     
  • Terminated/completed: This is a state where the process completes with the execution part.
     
  • Zombie: This is a state where the process is terminated. The process consists of information after the termination as well.


Question 8: What are the various modes of vi editors?

Answer: VI stands for Visual Editor. It is a default text editor. There are three types of modes in the VI editor.

  • Regular mode/Command mode.
     
  • Insertion mode/Edit mode.
     
  • Replacement mode/Ex mode.


Question 9: What do you mean by Linux Directory Commands?

Answer: The five Linux directory commands which are used to work with directories and files are the following:

  • pwd: pwd is an abbreviation for print working directory. This is a command which is used for path display. $pwd is the syntax used for pwd.
     
  • cd: cd is an abbreviation for change directory. This is a command used to change the present working directory to the directory that we want to work on. $cd <path to new directory> is used as a syntax for cd.
     
  • Is: Is is an abbreviation for list. This is a command used to show the complete list of content of files and directories. $ls is used as a syntax for Is.
     
  • mkdir: mkdir is an abbreviation for make directory. This command allows users to create directories in Linux.  $ mkdir <name of new directory> is used as a syntax for mkdir.
     
  • rmdir: rmdir is an abbreviation for removing a directory. This command is used to remove or delete each directory that is specified on the command line.  $ rmdir <name of directory> is used as a syntax for rmdir.


Question 10: What are Process Management System Calls in Linux?

Answer: The process management system calls in Linux:

  • fork() system callIt is used to create a new process in Linux.
     
  • exec(): It is used to execute new processes in Linux.
     
  • wait(): It is used to wait for the process until the execution part is not done.
     
  • exit(): It is used to exit from the process.
     
  • getpid(): It is used to find the unique process id in Linux. 
     
  • getppid(): It is used to find the unique parent process id in Linux. 

Frequently Asked Questions

Explain about Linux terminal.

A Unix-like operating system is Linux. The terminal offered by the Linux system is used to run all Linux/Unix commands. This terminal works in the same way as the command prompt in Windows. Commands in Linux/Unix are case-sensitive. All administrative operations can be completed through the terminal. Package installation, file manipulation, and user management are all included. The Linux terminal allows users to interact with it. The terminal displays the results of commands that the user has entered. Only when you press the Enter key does the entered command get executed.

Why is Linux better?

The fact that Linux is open-source software is its key selling point. The source code for Linux is open source and free to access, modify, and contribute to by anybody with the necessary expertise. One of the most appealing aspects of Linux is that there are no forced reboots or irritating update nags. And the fact that the majority of the software was updated concurrently with the system. IPtables provide an even higher level of security for Linux machines. This is a firewall that allows you to establish a more secure environment for running commands or connecting to the internet.

What are the disadvantages of Linux?

The disadvantages of Linux can be listed as follows: It isn't exactly user-friendly. As a result, it may be puzzling to freshers and In comparison to Windows, it contains fewer peripheral hardware drivers.

Conclusion

Dealing with many questions, we came to the end of the article. I hope these questions help you in learning Linux interview questions. So far, we have discussed easy, medium, and hard-level Linux interview questions. You can read more such articles on our platform, Coding Ninjas Studio. If you want to improve or practice coding questions visit our website Coding Ninjas and grab your dream jobs in product-based companies. For interview preparation, you can read Interview Experiences of popular companies. 

Recommended Readings:

Happy Coding!

Previous article
UiPath Interview Questions
Next article
TOP MS Office Interview Questions and Answers
Live masterclass