You may get overwhelmed with various types of why, how, and what of Linux. So, we have collected 100 important Linux interview questions to make your work easier.
Linux Interview Questions with Answers
- What’s Linux?
Linux is a free operating system quite similar to UNIX. - Name the inventor of Linux.
Linux was developed by Finnish-American software engineer Linus Torvalds in 1991. - What’s an open-source OS?
An open-source operating system means users can modify the source code and create their own versions of the software. - Name some hardware platforms where Linux can be run.
Linux can be run on various hardware platforms, including laptops, desktop computers, smartphones, tablets, raspberry pi, and so on. - What does manage hardware resources?
Linux kernel manages hardware resources for Linux users. - What’s Linux Kernel?
Linux Kernel is the core part of the Linux operating system. Kernel offers basic services to other components of the OS. Also, it interacts with user commands. Linux kernel is a free, modular, monolithic, multitasking, open-source, Unix-like OS kernel. It was created by Finnish-American software engineer Linus Torvalds in 1991. C and assembly language were used to write its code. Kernel 5.16.3 is its latest version. - Is it legal if you use the Linux Kernel?
Linux Kernel is free and open-source software. It comes under General Public License, shortened to GPL. Hence, it’s legal for anyone to edit the kernel.
- Explain one task performed by the kernel.
Linux kernel manages your computer resources. Kernel enables a smooth run of various computer programs. Also, it allows the programs to use computer resources, such as CPU, memory, and i/o devices. - How is the kernel useful in process management?
The kernel takes care of process management. The kernel allows more than one process to run simultaneously. - How do the processes access the devices attached to the computer?
Processes access the devices attached with the help of the Linux kernel. - Can you perform multiple tasks on Linux?
Yes, Linux users can perform multiple tasks at once. - What’s the role of the Linux kernel in managing memory?
Linux kernel can access the system’s memory. So, it allows running processes to access the memory whenever needed. - What’s the role of the Linux kernel in managing system calls?
When the processes want to access the services, system calls are required. The kernel avails system calls for that purpose. - What do you mean by a Command Line Interface?
Command Line Interface, often shortened to CLI, is an interface that allows users to write declarative commands for instructing the computer to perform tasks. - What are the characteristics of Command Line Interface?
Below are the characteristics of CLI.- CLI is highly flexible.
- OSes implement CLI in a program known as a Shell. It gives interactive access to the operating system’s services and functions.
- Does Ctrl+Alt+Del key combination work on Linux?
Yes, Ctrl+Alt+Del key combination works on Linux. Just like Windows, this provides a system restart. The only difference is, on Linux, you won’t get any confirmation note, resulting in an immediate reboot of the system. - How would you copy files to a Floppy Disk?
For copying files to a Floppy Disk without any problem, we should follow the steps given below.- Mount the floppy disk
- Copy the files to the disk
- Unmount the floppy disk safely
- How many process states are there in Linux?
There are five process states in Linux: new or ready, running, blocked or wait, zombie, and terminated. - What does happen in the New process state?
In the New or Ready process state, a brand new process gets created and becomes ready to run. - What do you mean by the Running process state?
The process being executed defines the Running process state. - What do you mean by Blocked process state?
In the Blocked or Wait process state, a process waits for input from the user. - Define the Terminated process state.
When a process has finished the execution or is terminated by the OS, it’s called a Terminated or Completed state. - What’s the Zombie process state?
In the Zombie process state, the process is deleted, but the information related to the process still remains in the process table. - What are the system calls used for process management in Linux?
System calls used for process management in Linux are fork(), exit(), wait(), exec(), nice(), getpid(), getppid(). - What’s the functionality of fork()?
Fork() is used for creating new processes. - What’s the functionality of exit()?
Exit() is used to exit from the processes. - What’s the functionality of wait()?
The wait() is used for waiting until the process completes its execution. - What’s the functionality of exec()?
The exec() executes a new program. - What’s the function of nice()?
The nice() is used to bias the property of a process. - What’s the role of getppid()?
The getppid() gets the unique id of the parent process. - What’s the role of getpid()?
The getpid() gets the unique id of the process. - What are Inode and Process Id?
The inode or index node is the unique name given to each file. Process Id is the unique name given to each of the processes. - What is Swap Space?
Swap space is a part of a hard disk’s space that can be a substitute for physical memory. - How does swap space work?
Swap space works as virtual memory. It contains process memory images. During the memory shortage, your computer uses virtual memory. Swap space fulfils the RAM requirement of the operating system. - What’s swapping?
This information exchange between real memory and virtual memory is called swapping. - Mention one advantage of using swap space.
If your system has enough swap files, it keeps some amount of physical memory free. - Why should we keep some physical memory free?
The free physical memory can be used for different vital operations. - Where are the unused applications kept?
Unused or less used applications are usually kept in a swap file. - How can swap space be used in reading or writing files?
Swap space can be used as a single memory to reduce I/O operations during reading or writing files. - Name two important features of the Linux operating system.
Two important features of the Linux OS are:- Linux distributions come with live USB or CD required for installation purposes.
- Linux has customized keyboards and outstanding application support.
- Which are the high-security services offered by Linux?
Linux provides high-security services, such as Authentication, Encryption, and Authorization. - How’s the file system offered by Linux?
Linux offers a hierarchical file system, and its source code is free for everyone. - Can you run Linux application programs on any hardware?
Yes, the Linux kernel and the application programs are compatible with any hardware platform. - What are daemons?
Daemons are services that offer different functions that are not necessarily available under the base OS. Daemons receive service requests and respond as per the requests. Once the service is completed, it’s disconnected and then waits for the next requests. - Name some daemons used in Linux.
Daemons used in Linux are httpd, ftpd, amd, sshd, mysql, etc. - Mention one speciality of Daemons used in Linux.
Daemons mostly have ‘d’ at the end of their process names. - What’s the full form of HTTPD?
HTTPD stands for Hypertext Transfer Protocol Daemon. - What’s the purpose of HTTPD?
HTTPD runs in the background and works as a server. - What’s the other name of the HTTP server?
The HTTP server is better known as the Web Server. - What’s the full form of FTPD?
FTPD stands for File Transfer Protocol Daemon. - What’s the full form of TCP?
TCP stands for Transmission Control Protocol. - What’s the full form of AMD?
AMD stands for AutoMount Daemon. - What’s the purpose of AMD?
AMD takes care of mounted file systems’ cache. - What’s the full form of NFSD?
NFSD stands for Network File Sharing Daemon. - What’s the purpose of NFSD?
NFSD runs on a server. It manages client requests coming for file system operations. - What’s AFS?
AFS or Andrew File System is a distributed NFS used for facilitating stored server file access among AFS client computers placed in different areas. - Who developed AFS?
AFS was developed by Carnegie Mellon University. Later it was further developed by Transarc Corporation and IBM. - Mention one difference between AFS and NFS.
AFS has stateful servers.NFS has stateless servers. - Explain the PWD command.
When you open the Linux terminal, you land up to the user’s home directory. Using the PWD command lets you easily understand which directory it is. It provides the absolute path. The path starts from the root. The root is the Linux file system’s base. It’s denoted by the “/” (forward slash) sign. The user directory looks like “/home/username”. - What’s the full form of SSHD?
SSHD stands for Secure Shell Server Daemon - What’s the purpose of SSHD?
SSHD provides secured and encrypted communications between untrusted hosts across an insecure network. - What do you mean by a computer file system?
In short, filesystem or FS, a computer file system is a data structure and method used by an OS for controlling data storage and retrieval. - What’s a Linux shell?
The shell is the command-line interpreter of Linux. Linux shell acts as an interface between the kernel and the user. It’s used to execute programs called commands in Linux operating system. For instance, if you’ll enter LS, the shell will execute the LS command. Also, the Linux shell is able to execute many other programs, such as scripts, applications, and user programs. The shell is written in C or shell programming language. - Which are the shells used in Linux?
Some commonly used shells of Linux are BASH, CSH, KSH, and FISH. - What’s BASH?
BASH stands for Bourne Again Shell. BASH is the default shell found in most of the Linux distros. - What’s CSH?
CSH stands for C Shell. CSH is based on C-like syntax. And it offers job control and spelling correction. - How to clear the cache in linux?
echo 1 > /proc/sys/vm/drop_caches - How to get the stack trace of a process on Linux
Run pstack or run gdb and attach to process and use backtrace command - What do you mean by a Virtual Desktop?
A virtual desktop is a preconfigured image of an operating system and applications where the desktop environment is kept separated from the real physical device. That physical device is used for accessing it. - How do the users access a virtual desktop?
Users access virtual desktops remotely via a network. An endpoint device, like a smartphone, laptop, or tablet, is used for accessing a virtual desktop. - How do a virtual desktop work?
The virtual desktop works like a physical workstation. The VD service provider installs client software over the endpoint device. And the user interacts with the software on the device. - What are the approaches to desktop virtualization?
There are mainly 5 approaches to desktop virtualization. These are,- Remote Desktop Service or RDS
- Operating system provisioning
- Client hypervisors
- Application virtualization
- Client-side hosted virtual desktops
- What’s a hypervisor?
A hypervisor is a software, hardware, or firmware that creates and runs VMs (virtual machines). - What are client hypervisors?
Client hypervisors are hypervisors designed for the purpose of using in client’s computers, such as workstations, desktops, or laptops, rather than using on a server. - What’s a server?
A server is computer software or hardware which offers functionality to other devices or programs, known as clients. - What’s the other name used for the remote desktop services?
Remote desktop services or RDS is also known as Terminal Services. - What’s the full form of RDP?
The full form of RDP is Remote Desktop Protocol. - What do you mean by operating system provisioning?
Operating system provisioning means installing an operating system over a number of host computers. - What’s application virtualization?
Application virtualization is a technology that lets users use any application from a different computer than the one machine where the application has been installed. - What’s the right size for a swap partition?
The ideal size for swap partition should be 2X of the RAM space installed in the computer. So for a 64 KB RAM, the swap space should be 128 KB. - What are virtual desktops?
Virtual desktops are operating systems and applications’ preconfigured images. Here desktop environment and the physical device used for accessing it are different. - What’s the root account in Linux?
The Root is the superuser account in Linux. - What are the basic components of Linux?
Linux OS has three basic components: kernel, system library, and system utility. - How many permissions are there in Linux?
There are mainly three types of file permissions in Linux: read, write, and execute. - What’s the Linux kernel?
Linux kernel is Linux’s core part. All major activities of the OS are performed by the Linux kernel. The kernel has various modules. It interacts with the underlying hardware. Linux kernel offers the required abstraction for hiding low hardware details. - What do you mean by the Write file permission?
With the Write permission, you have the authority to modify or change file contents. You can simply add, rename, and remove files that are stored in the directory. In any case, if you have the Write permission on the file but don’t have it on the directory, you can modify file contents. However, you can’t rename, remove, or move the file from the directory. - What’s the Execute file permission?
In Linux, you must set the Execute permission for running a program. If this isn’t set, you might be able to modify and see the program code, but you can’t run the program. - How many Linux file ownerships are there?
There are three types of Linux file ownerships such as User, Group, and Other. - What do you mean by system libraries in Linux?
In Linux, the system libraries are programs or special functions. Access Kernel features using these programs, system utilities, or application programs. System libraries implement operating system’s functionalities. They don’t require code access rights of Linux kernel modules. - What do you understand by system utility in Linux?
Linux uses applications called utilities that help users manage the computer. There are different utility programs. These vary across OSes. System utility is often accessed via the control panel or a special menu in the operating system. - What’s the role of the Read file permission?
With the Read file permission, you have the authority to read a file. You can list the content of a directory if you have the Read permission on the same. Also, you can open a file with the Read file permission. - What are the differences between BASH and DOS?
The major differences between BASH and DOS consoles are as given below.- BASH commands are generally case-sensitive. DOS commands aren’t case-sensitive.
- In BASH, \ is an escape character and / acts as a directory separator. In DOS, \ acts as the directory separator and / is a command argument delimiter.
- DOS follows a particular convention in naming files. This is 8 character file name, a dot, and 3 characters for the extension. BASH doesn’t follow any such convention.
- What’s TCP?
TCP stands for Transmission Control Protocol. It’s a transport protocol used to ensure packets’ reliable transmission. TCP provides mechanisms for solving problems caused by packet-based messaging, such as out-of-order packets, corrupted packets, duplicate packets, and lost packets. - What does the CTRL+Q shortcut do in Linux?
In Linux, the CTRL+Q shortcut quits the application in focus. - What does the CTRL+ALT+F7 shortcut do in Linux?
In Linux, the CTRL+ALT+F7 switches to the first graphics terminal. - Briefly explain the history of Linux.
Linux began its journey in 1991 as a hobby project by Linus Torvalds. Linus was a Finnish student who aimed to create a free OS kernel. Today’s Linux kernel results from constant efforts put throughout the past years. The source code was first released in 1991. Initially, Linux was a collection of a small number of files written in the C programming language. At that time, it was released under a license that prohibited commercial distribution. In mid-December of 1992, the kernel was released under the GNU GPL license. Around 2000, kernel started using the GPLv2 license. And in 2007, the GPLv3 license was released.Linus wanted to call this newly created OS Linux but dismissed the idea of being egotistical. So, he named the project Freax. Freax was a combination of “free”, “freak”, “x” from Unix. However, the team chose the name Linux as more appropriate later on.
- What does the CTRL+S shortcut do in Linux?
In Linux, the CTRL+S saves the presently opened file. - What’s Run level 0?
The run level 0 denotes system halt. It means the system can be powered off without any activity. - What do you mean by a run level?
In Unix-based OSes, a Run level signifies the state of the computer after boot. Runlevel is previously set on various Linux distributions. There are seven Run levels, starting from zero to six. Run levels determine the programs to be executed after the operating system boots up. System admins assign a default run level as per their requirements. You can find out your computer’s current run level using the /sbin/runlevel command. - What does the CAL command do? Give its syntax.
In Linux, CAL is a calendar command. If you want to see a year’s calendar or a specific month, you need to use CAL. The syntax of the CAL command is given below.
cal [ [ month ] year]
The Conclusion
And that’s a wrap-up! This article presents you with a compilation of 100 important Linux interview questions along with their answers. I hope you find these questions helpful, and don’t forget to go through them before your next Linux interview. All the best!