Are you looking for a good career through Linux administration? It is great to have a quick review of Linux interview questions that would help you grab complex interviews from any organization. Linux is one of the operating systems commonly used by most organizations for a long time. Linux is an open-source, customized operating system. In the current era of living, we see many new technologies and improvements coming up. Linux is one of the platforms that help organizations achieve their success within a shorter time span. Let us have a quick review of the Linux interview questions that are curated by the experts in the Linux training.
Ans. Linux is an Open-Source Operating System first introduced by Linus Torvalds. It is based on UNIX and it is available freely. It can be executed on different hardware platforms such as Intel, HP, MIPS, Motorola, SPARC, IBM, etc.
Ans. Major components in the Linux operating system are:
Ans. Using the command ‘cat /proc/net/bonding/bond0,’ we can check what mode is enabled and what LAN cards are used in this bond. In this example, we have one bond interface. However, we can have multiple bond interfaces like bond1, bond2, and so on.
Ans. Kernal essentially refers to that core component of the PC working framework that gives fundamental administrations to alternate parts and in addition connects with client summons. With regards to 'Linux Kernal, it is referred to as low-level system software providing an interface for user-level interactions.
Linux Kernal is considered as free and open-source programming which is fit for managing hardware resources for the clients. As it is released under General Public License (GPL), it winds up legal for anybody to alter it.
Ans. LINUX is used widely because it is completely different from other operating systems with something extra i.e. some additional features
Ans. GUI stands for the Graphical user interface. GUI is considered as the most attractive and user-friendly because it consists of the usage of images and icons.
Ans. CLI stands for Command Line Interface. It is a way for humans to interact with computers and is also known as a Command-line user interface.
Inclined to build a profession as Linux Developer? Then here is the blog post on, explore Linux Training |
Ans. The maximum length for any filename under Linux is 255 characters.
Ans. Add following entry in /etc/fstab LABEL=/home /home ext3 acl 1 2 Now remount /home partition with acl option. mount -t ext3 -o acl /dev/sda3 /home
Ans. # mke2fs -t ext4 /dev/DEV
Ans. By default, the main system log is ‘/var/log/messages’. This file contains all the messages and the script written by the user. By default, all scripts are saved in this file. This is the standard system log file, which contains messages from all system software, non-kernel boot issues, and messages that go to ‘dmesg’. dmesg is a system file that is written upon system boot.
Ans. When you select only a portion of your file hierarchy or a single partition to back up, it is called partial backup.
Ans.
LINUX | UNIX |
LINUX is an open-source free operating system used in the functioning of computer hardware & software, system application, game development etc. | UNIX is also an operating system mostly used in internet servers, HP, intel etc. |
LINUX is available in both the versions- freely downloaded and distributed as well as priced minimally. | UNIX comes in different versions with different price structures. |
Linux can be easily used by anyone such as web developers, software engineers, home users, etc. | UNIX is developed to be generally used for servers, mainframes, and workstations. |
The file support system in LINUX comprises Ext2 to Ext4, Xfs, Jfs, FAT, Btrfs, etc. | The file support system in UNIX consists of gpfs, jfs hfs, etc. |
In LINUX, BASH (Bourne Again Shell) serves as the Linux default shell i.e. text-mode interface that can be executed on multiple command-line interpreters. | Bourne shell acts as the text mode interface that is compatible with multiple other interfaces including BASH. |
LINUX comprises two GUIs, Gnome and KDE. | In UNIX, the Common desktop environment serves as a GUI. |
Examples: Fedora, Red Hat, Debian, Ubuntu, etc. | Examples: Linux, Solaris |
Ans. In Linux, commands are case-sensitive, and more often than not they are entirely in lowercase. Items that are surrounded by brackets ([]) are optional. You will more than likely use at least some of these commands every time you log into a Linux system. Become familiar with these commands because they can get you pretty far in a short amount of time.
Related Articles: Linux Tutorials |
Ans. Automatic or batch processes are not connected to a terminal. Rather, these are tasks that can be queued into a spooler area, where they wait to be executed on a FIFO (first-in, first-out) basis. Such tasks can be executed using one of two criteria:
Ans. The low-level system software is referred to as the Linux kernel. It is mainly used to allocate resources and to provide a medium for the user interface.
Yes, it is possible as well as legal to edit Linux Kernel. Since Linux comes under the General Public License (General Public License), it can be edited and modified by the end-users.
Ans. BASH refers to Bourne Again SHell. It is a replacement of the initial Bourne shell represented by/bin/sh. And it is created by Steve Bourne. It is the better version of the previous and original bourne shell as it contains unique additional features that are easy to use. Later it got adopted as a default shell script for most of the systems operating Linux.
Ans. LILO is a term given to Linux LOader. It loads the Linux Operating System into the system’s main memory for execution. Mostly all the computers come with inbuilt boot loaders in some of the versions of Mac OS or windows. For using Linux OS, a special boot loader needs to be installed in the system and one such boot loader is LILO. One of the major advantages of using this boot loader is that it can boot Linux OS really fast.
Ans. Some of the common Shells that are used in Linux are
Ans. It is a space that temporarily stores concurrent executing programs in Linux. When RAM has a shortage of enough space to store the programs that are executing in a system, then swap space comes into action.
Ans. There are many reasons why LINUX is preferred over other operating systems. Some of them are listed below.
Ans. It is the primary account similar to a system administrator that controls all the functioning in the system. It is a default account that gets loaded whenever the Linux is set up. Some of the functions performed by the root account are:
Ans. In open-source, software including the source code is distributed without any cost to the end-users. People can customize the source code to customize and add features of their choice. They can even debug the source code if any error creeps in. The whole community can be benefited with enhanced features as the people can again distribute it freely after customizing it.
Ans.
Sl. no. | BASH | BASH |
1. | Commands used for different functions are case-sensitive. | Commands used for different functions are not case-sensitive. |
2. | (‘/’ forward slash) in BASH is used to separate directories. (” backslash) is used as an escape character. | (‘/’ forward slash) in DOS is used as a command argument delimiter. (” backslash) is used as a directory separator. |
3. | A naming convention is followed in which 8 characters are fixed for file name postfixed with 3 characters for the extension. | A naming convention is not followed |
Ans. GNU being a free software movement provides several advantages as it gives the flexibility to modify the programs according to their use and convenience. It is also allowed to redistribute the modified copies of the software for free and release it for the public to use it.
Ans. The command prompt is found in the default shell and to open it Ctrl-Alt-F1 is pressed. This will start the command-line interface (CLI) from which commands can be entered and executed.
Ans. Generally, the size of the swap partition is twice the size of the physical memory present in the system. If it is not possible to have this size, then the minimum required size for a swap partition is the amount of memory present in the system
Ans. This is a special feature which is very useful for the users who enhance the physical boundaries of a screen to a larger extent. With a virtual desktop, a virtual screen is created that can expand the normal screen of the system. A virtual desktop can be implemented by using 2 ways
Switching Desktops
With switching desktops, distinct virtual desktops can be created to run programs. Each virtual desktop acts as a separate desktop and programs executing on these desktops can only be accessed by the users who are using that particular virtual desktop
Oversized Desktops
It does not provide distant desktops but lets the user scroll over a desktop that is expanded and is larger in size than the desktop having a normal physical screen.
Ans. Symbolic links are the same as shortcuts in Windows and they point to files or directories and programs. It provides instant access to the desired directories or files without going to the full pathname.
Ans. Daemons are those computer programs that run as a background process to execute those functions that are not there in the base Operating System. They are used to run the services in the background so that they can not be directly controlled by the end-users. They are also used to handle periodic requests so that these requests can be sent to the appropriate programs for implementation.
Ans. Only system administrators or file owners can grant or change the access permissions in Linux. Permissions are granted using the chmod command. + symbol is used to add permission and – symbol is used to deny permission, followed by any of these letters: u (user), o (others), g (group), an (all), r (read), w (write) and x (execute). For instance, the command chmod u+rw FILE23.TXT is used to grant read and write access to the file FILE23.TXT, which is assigned to users.
Ans. The process states in Linux are:
Ans. In Linux, numbers are assigned as a suffix to the drive identifier. For instance, the first IDE hard drive had three primary partitions, will be written as name/number just like /dev/hda1, /dev/hda2, and /dev/hda3.
Ans. Grep is the term used for Global Regular Expression Print. It is used to search for a text expression in a file by matching the patterns based on a regular expression.
It follows the following syntax
Syntax: grep [text options] pattern [filename]
For Example:
$ grep -c "shell script" inlinux.txt
This command will print the count of the word “shell script” in the “inlinux.txt” file.
Ans. Hard links are the links that point directly to the file and not to the pathname. It means even if the file is renamed or moved from one location to the other, the link will remain the same as the link is for the file and not for the path where the file is located.
Ans. Process management system calls are:
Ans. The ls command lists down all the files in a particular directory. The syntax for using this command is:
$ ls
For instance: The command to list all the files in the tutorial directory will be as follows:
$ ls tutorial/
Different options can be used with the ls command to provide extra information about the file/folder from where information needs to be fetched. The options are:
Ans. Generally, all the hidden files are preceded by a dot. These files hold important or setup info as they can be configuration files. Keeping these files as hidden makes them secure from being accidentally deleted.
Ans. The redirection operator is used when there is a need to use the output of one command as an input to the other command or file. It is generally used in 2 ways
‘>’ – this operator overwrites the existing data in the file or makes a new file.
‘>>’ appends the new data at the end of the file or makes a new file.
So in simple words, in this ‘>’ redirection operator, the data in the file is overwritten and in this ‘>>’ redirection operator, the data is appended.
Ans. Yes, it is possible to execute several commands from a single command line entry by separating them using a semicolon symbol. For instance: Consider the example below in which a series of commands are issued from a single entry.
ls –l cd .. ls –an EXAMPLE of having 3 commands from the single line: ls -l cd.. ls -an EXAMPLE
Ans. An archived file can be created or extracted by using the tar command in Linux. For instance: to extract all the files from the archive ‘example.tar.gz’, the following command will be used:
$ tar -xvzf example.tar.gz
To create an archive of all the file stored in /home/linux/, the following command can be used:
$ tar -xvzf filename.tar.gz
where c refers to create an archive, x refers to extract, v refers to verbose and f refers to file
Ans. For sharing the programs across different virtual desktops, press the button in the upper left-hand corner of a window which appears to be a pushpin. It will "pin" that application thus making it visible at the same position on the physical screen in all virtual desktops.
Ans. A Latch is a binary storage device that stores the file temporarily and is controlled by a timing signal with the value being either 0 or 1. It has two stable states. The high output state denotes 1 and a low output state denotes 0. If the power is on, it can store 1 bit of data.
Ans. In Linux, an empty directory acts as the nameless base of the file system. It serves as an attachment for all other files, directories, devices, and drives.
Ans. It is a single-chip device that is used to execute commands. It fetches, decodes, and then decodes the instructions from the memory. The basic functions carried out by microprocessor are:
basic mathematical operations such as add, subtract, multiply, and divide
moving data from one place to another
decision making based on the conditions and then moving on to new instructions based on those decisions.
Ans. The pwd command refers to the print working directory. It displays the pathname of the directory which is currently in use.
For instance: If we will write the below command
Pwd
The following output will be generated:
/home/ajay12/myDir
Ans. Regular Expressions in Linux are used to search for options with specified patterns. Some commands used with regular expressions are sed, tr,vi and grep.
Some symbols used with Regular Expressions are:
. | To match any character |
$ | To match the end of the String |
^ | To match the beginning of the String |
It is used to depict special characters | |
* | To match zero or more than one characters |
? | It is used to match exactly one character |
Ans. Considering that these two desktop environments are already installed, just log out from the current session through the user interface. Then again login from the login screen by entering the ID and password and choose the session type you wish to continue with. This will remain the default desktop environment until you change it to some other environment.
Ans. Linux being a case sensitive language, it can alter the output if every character is not encoded as it is including the uppercase and lowercase letters. For instance- CD, cd, and Cd will produce different outputs as these are three different commands. If a command is written in lowercase where it should be in uppercase, it will generate different results.
Ans. Minimum 2 partitions are required to install Linux. In one partition, all the local files are stored including configuration files of the OS, application files and services along with user files. The second partition is used as Swap Space which is an extended memory for RAM in Linux.
Ans. Environmental variables are also known as global shell variables. They are global settings responsible for controlling the shell’s function along with other Linux programs.
Ans. Shortcuts can be created by using a feature called filename expansion in which the TAB key is used for this purpose. The condition is that the pathname should be unique and the shell which is in use should support this feature. For instance, pathname /home/shell/example directory, will be written as follows: /ho[tab]/she[tab]/exa[tab].
Ans. Vi editor uses 3 modes for its functioning
Ans. It works similarly as in windows to restart a system. The only difference is that the reboot starts immediately in Linux after striking this key combination without giving any notification or confirmation message.
Ans. This directory holds locally installed files and is mainly used in the environments where files are generally stored in a network. They are used for those software packages that are installed from the source or software that are not official to use. Local files normally go to /usr/local/bin, /usr/local/lib etc. kinds of directories in Linux.
Ans. Linux distributors are often called Distros. Different parts of LINUX such as the kernel, graphical programs, system environment etc. are developed and distributed by different organizations. Distros assemble these parts and compile them in an operating system that is ready to be installed in a system for use. There are more than six hundred Linux distributors in the market but some of the well-known distributors are
Ans. Comments are always followed by a # symbol in Linux. From this symbol, shell understands that this is a comment and not a command. Shell completely ignores the content which is followed by # symbol. For instance "# Comment is followed by this symbol and not the command."
Ans. It is important to determine the total memory used by different programs in Linux in order to analyze whether the resources and the server is being used adequately by the users or not. Below are some of the methods to find out the memory in use.
Free command: Memory usage can be checked by this simple command. For instance, ‘$ free –m’, in this command’ displays all the data in MBs.
Vmstat: With this command, the memory usage statistics can be known. For instance, ‘$ vmstat –s’
/proc/meminfo: Memory in use can also be known by reading the file /proc/meminfo file. For instance, ‘$ cat /proc/meminfo’
Top command: Total memory which is in use along with the RAM usage can be determined by using this command.
Htop: Memory usage along with other useful details can be displayed by using this command.
Ans. Every process has a unique id known as pid in Linux. Kill command followed by pid is used to terminate a process. To terminate all the processes in one go, kill 0 is followed by pid.
Ans. Parentheses can be used to group commands in Linux. For instance, To send the recent date and time along with a file named EXAMPLE to a second file named GROUPING, command grouping can be applied by using this command (date cat EXAMPLE) >GROUPING
Ans: Linux is referred to as one of the most common and popular operating systems that are designed with the Linux Kernel. The Linux operating system is an open-source operating system that is capable of running on multiple platforms. The primary focus of this operating system is to provide the users with a less expensive operating system and free operating system to utilize while working within the organization for multiple projects. The Linux Operating system is also called a user-friendly operating system. It provides the flexibility to users to modify things easily and enables the user to perform the creation of variations within the source code.
Below are the significant differences between Linux and Unix: LINUX operating system is portable while the Unix operating system is not portable. LINUX operating system is an open-source operating system that is free of cost, and the users from the internet can download it by making use of the GNU license. In contrast, the Unix operating system is not free of cost. LINUX operating system makes use of the which also includes a command-line interface which is an optional thing. The Unix operating system controls only the command-line interface.
Ans: There are three permission types that are available in Linux for each file or directory. They are:
Read: This file permission type is used for reading the file.
Write: This file permission type is used for writing the fine or for performing any modification to the file of a directory.
Execute: This file permission is used to execute the file, which will affect the user's capability and view the directory's file.
Ans: Linux is more secure because of the following reasons:
Ans:
CLI: CLI refers to a command-line interpreter used for interacting between the different computer programs. It is usually represented in the form of text format. It is also responsible for allowing the users to add the text lines, which can be further converted into user-defined commands.
BASH: BASH is referred to as a Unix command, which is written by Brian Fox. Bash is also referred to as free software that is also the replacement for The Bourne shell. BASH allows the users to write the command and perform the related actions, even allowing the users to read the commands that are written in the form of Shell Scripts.
Ans: There are different features available in the Linux operating system. They are explained below:
Portable: LINUX operating system is designed in such a way that it can work on multiple types of hardware. The data is allowed to be carried in the pen drives and memory cards, allowing it to be included in the probability feature.
Open source: The Linux operating system is a free, open-source operating system that is based on the community development project.
Multiprogramming: LINUX operating system provides the feature of multiprogramming, allowing users to run multiple programs at the same time.
Multi-user: the applications are allowed to be created and used by multiple users. In Linux, various users can use their RAM and run the programs at the same time.
Security: Linux is flexible to provide data security by using the different forms of security policies or security features like authorization, authentication, and encryption.
Ans: Linux Kernel is referred to as a low-level system software with the primary responsibility of managing the user's resources. Linux Kernel is also responsible for providing an interface or a bridge for user-level interaction.
Ans: LILO refers to Linux loader. Linux loader is referred to as the bootloader for Linux. The bootloader's primary responsibility for Linux is to mainly load the Linux operating system into the main memory so that it can start working on the operations.
Ans: GUI refers to a graphical user interface that uses the images and Icon so that users can click and navigate checkout to communicate with the machine or a computer. The graphical elements make it easier to interact with the system instead of using the different commands and type the commands, which is more challenging for a human to remember.GUI will also improve the attraction through the icons, color, and images bringing up a good view.
Linux Tutorials
Ans: Below is the list of commands of the Linux directory.
pwd: This command is used for a print working directory. It is referred to as a built-in command that displays the current working location and the working path along with the full path of the directory.
Is: This command is used for listing the files in the directory folder.
cd: command is used for change directory, which is used for changing the directory from the present directory to the directory that you want to work.
mkdir: This command is used for creating a new directory.
rmdir: This Command is used explicitly for removing the directory from the system.
Ans: The cat command in Linux is used for concatenating and printing the files. Users use this command to check the contents of the dependencies file and confirm the version of the application that they are built already locally.
Ans: A pipe in Linux is referred to as a form of redirection in Linux. The PIPE is specifically used for combining more than two commands, and the output of one command will be taken as input for the next command.
Syntax:
command_1 | command_2 | command_3 |command_4 | .... | command_N
Ans: The Chmod command is responsible for changing the file permissions and directory permissions. The Chmod consists of three different types of permissions called to read, write, and execute. They are represented in numbers as below:
4- read permission
2- write permission
1- execute permission
Ans: Two different commands can be used for getting the exit from the VI editors.
wq: This command is used for exiting from the VI editor by saving the current work that you have done.
q! : This command is used to exiting from the VI editor without saving the work you have done.
Ans: There are three different modes of vi editors. They are:
Ans: The env command is referred to as a shell command that is used explicitly for printing the list of environment variables that run another process in another environment without performing any modifications of changes to the current environment.
Syntax: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
Ans: Yes, there is a possibility to append one file to another file in Linux. The command that is used to append from one file to another file is cat file 2 >> file 1. The operator >> in the command is used for appending the output of the named file and is also capable of creating the file if there is no file already created. The other command that is stated below is also used to append two or more files to one. Command: cat file 1 > file 2 > file 3
Ans: Below are the port numbers that are used for these services.
The two commands that are used for checking if the 4th and listening in the Linux server are:
netstat -l
netstat --listen
Ans: Environment variables are referred to as the global settings that will help control the cell's function and the other Linux programs. The environment variables are also called the Global shell variables.
Ans: Below is a list of the basic components of the light next architecture.
Kernel: Kernel is referred to as one of the most essential core components in the Linux operating system. It is referred to as an interface or a bridge between the software and hardware components.
Shell: Shell in Linux is also referred to as an interface between the parallel operating system and the users.
GUI: GUI refers to the graphical user interface used to establish the interaction with the system.
System Utilities: The system utilities are referred to as a software function responsible for allowing the users to manage the computer.
Application programs: Application programs here refer to the set of tasks that are specifically designed to perform the set of tasks or operations.
Ans: The swap space is referred to as a space that is allocated and used when we need actually to run the physical memory. Describe space is responsible for helping users move the inactive pages in their RAM to the swap space. The swap space is available in two different forms called partitions and swap files.
Ans: The hard links are used to directly point to the physical file on the desk but not on the pathname. Let us take an example and think that if you move the original file or remove the same, there will be no breaking of hard links as the link itself is used as a file, not the pathname, where the file will be stored in the directory.
Ans: Yes, the Control + alt + delete combination works on Linux, and it can be perfectly used to restart the system.
Ans: Daemons are usually referred to as a kind of service that will offer the different functionalities which we cannot find under the basic operating system. It includes the main tasks like listening for a service request and then performing an action on these requests. Once the service is completed, it will disconnect itself and wait for the next request that will be coming up.
Ans: The inode is referred to as a unique name given to any file or directory. The process ID is referred to as a unique name given to each process that is created.
Ans: Zombie is referred to the process state in which the child dies before the parent process dies. In this situation or scenario, the process's structural information will still exist in the process table. As a Process is dead, it will not react to any signals. The kernel is responsible for clearing the resources of the Zombie state processes.
Ans:
BASH: The Bash command is referred to as a case-sensitive command. Bash command does not follow any convention. Under the dash command, the characters are the directory separator and acts as an escape character.
DOS: DOS command is not Case sensitive command, and it follows a naming convention. Under those characters are referred to as the command argument delimiter.
Ans: The symbolic links In Linux are referred to as the shortcuts used in windows. The symbolic link will be pointing to the codes, files, programs, or directories and will also allow direct instant access to the entire pathnames.
Ans: A virtual Desktop usually refers to the alternative service used to minimize and maximize the multiple windows on the currently running desktop. The primary purpose of using the virtual desktop is for clearing and running one or more programs at one time. The virtual desktop will allow the users to perform the shifting between the desktop rather than minimizing; they are restoring the programs.
Ans: Below is a list of the different process states in Linux.
Ans: There are three types of file permission groups available based on each file or directory. They are:
I hope you have got an idea about the most frequently asked questions in the interview to crack the Linux administration positions. These questions will definitely help you in gaining knowledge about the different concepts in Linux. I would also recommend you to get trained and certified for a better and in-depth understanding of Linux and its usage.
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.