Linux Interview Questions

Linux Interview questions

Linux Interview Questions: The interviews for developers often include questions on the basics of Linux and other Unix-based operating systems. Others who have interviewed for various posts usually document these questions. The answers might vary from person to person but the concept remains the same and this can only be understood when the person is clear on the basics of Linux.

Linux is quite different from Windows but it has wide acceptance in some fields. Since it is an open-source software operating system, Linux is basically free and is used as a cross-platform operating system, which can easily be installed on PCs, laptops, video game consoles, and more. This is what opens up many applications for Linux and thus a demand for talented and knowledgeable professionals who are aware of the field they are working in. You will know a lot of the answers to the given questions if you have worked with the OS for a long time.

These questions and answers on Linux OS are sure to help you out in the interview by helping you understand the pattern of the questionnaire and the types of questions asked. So, here are the questions and their answers.

Linux Quick Questions
What is Linux An open-source operating system.
Developed ByLinus Torvalds and community
Written InC and assembly language
Default user interfaceUnix shell
Licensed underGPLv2 and others
First release17 September 1991
No. of Questions43

Linux Technical Interview Questions l2

Download Linux Interview questions PDF

Below are the list of Best Linux Interview questions and Answers

Linux is free open source multi-user operating system that is built on Linux kernel. Linus Torvalds released the first version of Linux operating system on September 17, 1991.

Some Difference between Linux and Unix Operating System:

LinuxUnix
Linux is open source anyone can use it free of cost.  UNIX is copyrighted only big companies like IBM AIX and Sun Solaris and HP-UX use it
Linux is just a kernel.   Unix is a complete operating system
By default, Linux supports and use ext3 or ext4 file systemsUnix comes with jfs, gpfs (AIX), jfs, gpfs (HP-UX), jfs, gpfs (Solaris) filesystems
Linux Redhat Enterprise, Fedora Linux, Debian Linux, Suse Enterprise Linux, Ubuntu Linux are some popular Linux OS.   HP-UX, IBM AIX, Sun Solaris, Mac OS X are some Unix based operating systems
Linux is considered as most user-friendlyApple OS X is most popular UNIX operating system for desktop usage.
Here are some of the differences between Linux and windows:

Linux

  • Linux is open source; the complete source code for Linux is available.
  • Linux is the GPL-licensed operating system, you are free to modify that software and use and even republish or sell it.
  • Download once and install it on as many PC you want.
  • Online peer support from the community via forums and online search.

Windows

  • Source code for windows is not available.
  • You can modify or redistribute Window operating system.
  • In Windows, you are bounded to use one license in One PC only. If you have to install it on other PC you need another License.
  • Paid to help desk support.
The kernel is the core of any operating system. Kernel acts as a middleman between computer hardware and operating system and controls everything on a computer. It is the first program that is loaded when a system starts.
<b>uname </b> is reporting command in Linux that is used to retrieve basic information about a computer’s hardware and software.

Synatax:  uname [options]

The whoami command is basically the concatenation of “Who”, “Am” and “I”. This command is used in both, Linux as well as Windows to display the details of the login user or the owner of the currently running login session. 
LILO comes from Linux Loader, which is a small program that manages dual boot and is, thus, also called as the boot loader. It was practically the default boot loader for quite a number of Linux distributions succeeding the fame achieved by loadlin. Although GRUB has grown increasingly popular recently, LILO and ELILO are still used widely. 

The UID of the administrator user refers to a unique positive integer that is assigned by the system to each user. It is the user identity definition that is used by the system to identify each user. On the other hand, the username is an interface for humans to recognize their account and log in to the system. 

The Is-R option or command is used to flag the lists of the directory in a recursive manner. 
LD_LIBRARY_PATH is an environment variable set of directories separated by colons. This is where any library should be searched for before accessing the standard set of directories for search. This is especially useful when the user is using a non-standard or general library for any special purposes or when a new library is being debugged. A different library can be substituted for the execution of this command particularly. 
The Linux boot files are the configuration files, which are accessed and called during the system booting operation. The usage of this /boot/directory is standardized in the File System Hierarchy as it holds all the files used in booting the system- it is the first file to be called during the system boot. It usually contains Linux kernel files or boot loader files. 
Take Free: Linux MCQ & Quiz
Searching for a pattern in a line or a file is fairly easy with the grep command. This command is executed when a particular pattern of characters must be searched. The grep filter searches one or more files as per the user command to search text strings using any expression.
Specifying the exact location of a directory or file from any well-established directory, preferably the root directory is known as an absolute path. On the other hand, relative path specifies the location of the directory or file with reference to the current location or the present working directory (pwd). 
Samba is software suite with open source. It runs on Linux OS and Unix/Linux based platforms. It is a reimplementation of the Common Internet File System (CIFS) and the more central Server Message Block (SMB) protocol. It is the standard Windows interoperability suite, which means that the software is able to communicate the programs of Linux to the Windows clients just like a native application. 
There are many commands, which display the free or used memory on Linux. The easiest way to track memory usage on Linux is by using the ‘free’ command. Linux and other Unix based operating systems generally show less free memory as might be available. That is why Swap (a special type of memory) is available for use when the RAM is full. 
The NFS mount options basically define how a client should handle or face a server crash or fail. In case of the soft mount, the client can report an error without waiting for a response from the NFS server. But this could also result in data corruption or data loss too. On the other hand, in case of the hard mount, the NFS file system repeatedly contacts the server until it receives a response. Once it reaches the server, the program will continue execution from the same point where it was stuck during the server crash. 
SSH stands for Secure Shell, which is a protocol for securely logging onto remote systems. It is the most common and simple way to access the remote Linux based servers. In order to do this, you must own a domain name and IP address. 
When the physical memory runs short, the computer, or rather the operating system makes use of both, hardware and software to compensate for the shortage of physical memory. It transfers the data from RAM to the disk space. 

There are three basic components of Linux:

  • Kernel: This is the core part of the Linux OS. 
  • System Libraries: These are special programs, functions or methods. The application programs and system utilities access the features of the kernel. 
  • System utilities: These are programs, which are responsible for accomplishing specialized tasks at the individual level.
The shebang or bang line is the absolute path from the root to the Bash interpreter. In a text file, the program loader parses the text in the initial line following the shebang as an interpreter directive. 
The env command is a shell command, which can be used to print out a list of the existing environment variables, or for running another program in a custom environment without altering the current one.
The chmod command is an abbreviation for Change Mode. This command is extremely useful for changing the permission for Files and folders located in Linux/Unix. File/Directory permission, which is generally Write, Read or executable for any user, group or others.
CLI is short for Command Line Interface and it is a human-computer interface. It is usually in sharp contrast to the Graphic User Interface (GUI), which is also used widely. In case of Linux, the GUI is used as an external wrapper to the basic CLI. 
SSH is basically a network protocol, which is used to remotely access and manage any device distantly. The chief difference between SSH and Telnet is that SSH makes use of encryption, which implies that the entire data transmitted over a network is secure from snooping. Telnet is not as secure though. Like Telnet, a user who wants to access a remote device must install an SSH client.
Set is an inbuilt shell, which displays all the shell variables including the environment variables. 
The Linux Operating System uses reserved disk block in the hard drive to swap. This is known as Swap Partition as no other files can be traced in the swap partition. In case of Windows OS, the swap space or partition is called swap file or page file. 
Comm produces a three-column output. It is basically a utility, which is used to compare two files for distinct and common lines. 
Grep stands for global regulation expression point. The command-line utility, grep, is used for searching data sets in plain-text for lines that match an expression which is used regularly. 
An NS record is operated to give a subdomain to a set of name servers. Whenever a user delegates a domain to DNSimple, the TLD authorities automatically place NS records for that domain in the TLD name servers. 

The PTR record is basically used as a spam filter and is used to authenticate the incoming messages. An A record should always exist for the PTR records. 

CNAME stands for Canonical Name, which is what this record provides to an alias name. 

MX stands for Mail Exchanger and the MX record is a special type of resource record in the DNS (Domain Name System). It specifies a mail server, which is completely responsible for accepting the messages via email on behalf of the recipient’s domain. A preference value is used to prioritize the mail delivery in case of multiple servers. 

SAR is an abbreviation for System Activity Report. This command is used to collect data, report and save the usage of CPU, a Memory unit, input, and output in Linux. 
A zombie process is also known as a defunct process. It is a process in the terminated state and has completed execution via the exit system call but still has an entry in the table of processes. 
This is the facility of the DNS implementation to provide the user with DNS information. It can provide a strong mechanism for privacy management and overall security. 
The recommended swap size is of 20% of RAM for modern systems. If hibernation is used, the swap should have a minimum of the same amount of space as the physical RAM. 
An inode is a data structure in the Linux file system. It stores all the available information on the file except for the name and the actual data stored in the file. This allows the system to use the data efficiently. 
Shell variables are local to the region they are defined in and are only available in the current shell. On the other hand, the user defines the environment variables interactively or in a startup file. A local variable can be made available as an environment variable by using ‘export VARNAME’. 
SSH port forwarding creates a secure connection between a remote machine through which services can be relayed and the local computer, which gives the commands. It is also called SSH tunneling and is used for transmission of information, which does not necessarily require an encrypted protocol. 
Making the file immutable by associating the immutable bit attribute to it prohibits even the root user from deleting it. 
The process status command or ps is used to provide information about the currently running status processes in the system. This includes the PID (process identification number), which is unique to every process or task. 
The mknod command is employed to create device files that can act strangely as compared to normal files. Device files are kept in the directory /dev, and unlike normal files, these device files are ones that the kernel knows about, and reads or writes to.
A hard link is simply an additional name for an existing file on Linux Operating System. They can also be created for other hard links. 

The nohup command is a POSIX command used to ignore the HUP signal. The HUP signal is, by standard, the way a terminal warns dependent processes of logout. 

Swap is the added space, which is used when the physical memory is full. The inactive pages and unnecessary data are moved to Swap Partition when more memory is needed in RAM. 
The SSL handshake enables the SSL client and the server to establish the secret keys with which they communicate. SSL or TLS makes use of the shared key for the symmetric encryption of messages, which is much faster than an asymmetric encryption.
This is a three-way handshake in terms of the transmission control protocol, which uses the SYN-SYN-ACK method. 

Kali Linux is a Linux distribution that is aimed at advanced penetration security and testing auditing. This Debian-based Linux is made up of hundreds of tools. Through these many tools, Kali Linux performs information security purposes or tasks like computer forensic, security research, reverse engineering, and others. The company called Offensive security is responsible for the development of Kali Linux, the funding as well as the maintenance. On the year 2013, it was released or launched to completely rebuild BackTrack Linux. The Kali Linux completely adheres to the development standards of Debian.

Nagios, a Linux monitoring tool, renders complete monitoring of Linux operating systems and distributions including operating system metrics, service status, process status, file system utilization, and a lot more. While using Nagios to control a Linux environment, you’re using one of the several powerful Linux monitoring tools on the planet. Executing effective Linux monitoring tools with Nagios extends benefits such as; improved server, services, and application availability, secure detection of network outages and protocol breakdowns and so on.

Linux Mint is a community-driven Linux distribution established on Ubuntu that endeavors to be a cushty OS that's both powerful and straightforward to use. It provides complete out-of-the-box multimedia support by involving some proprietary software, like multimedia codecs, and comes bundled with a spread of free and open-source applications.