Quicken your Linux administration career with HKR’s frequently designed Linux Administration interview questions and answer article. Linux is an operating system and it is distributed under open-source license management. This operating system is designed on the kernel source which can be used as a customized operating system. This Linux administration interview question and answer section help you to explore the different requirements set by Linux administration tools and also enables you to crack any complex interviews with any company. Let’s start our journey with Linux administration course Q & A and also its importance in any business workforce.
Ans: Linux is a popular operating system, which is designed on the base of Linux Kernel. This operating system is an open-source system and which can run on multiple hardware platforms. The importance of using the Linux operating system is to provide free and less expensive operating services for users. This operating system is also considered as a user-friendly work nature which can be modified easily and also enables the user to create variations in the source code.
Ans: Linus Torvalds created the Linux operating system. Linux Torvalds was a student at Helsinki University, Finland in 1991. During the time of his academic project, he started writing codes on his own to get the easier version of the UNIX for free. Later on, we started calling it Linux Kernel.
Ans: The following are the important differences between Linux and UNIX;
Linux | UNIX |
In Linux in both paid and free distributors available | Unix is available on different paid structures for unique levels of Unix |
Linux operating system uses the GUI which includes an optional command-line interface. | Unix included only command-line interface |
Linux operating system is portable to use which can be executed in different hard drives | Whereas UNIX is not portable to use |
Linux is designed by the worldwide Linux social community | Whereas UNIX is developed by the AT&T developer community |
Linux is a free open source system and the user can download it from the internet using GNU licenses | Most of the Unix operating systems are not free |
Linux can be operated at home-based personal computers, phones, tabs, etc. | UNIX is mainly used in server systems. |
Ans: The kernel is the core source of the Linux operating system.
Ans: Each file or directory has three permissions in Linux.
Ans: The CLI is nothing but a Command-line interpreter. This interpreter interacts with different computer programs, and it can be used in the form of text lines. The CLI interpreter also interacts with the computer terminals, and it enables users to add text lines and later they will be converted into user-defined commands.
Ans: BASH is a type of UNIX shell and the command lines are written by Brian Fox to work on GNU projects. It is free software and sometimes we can use it as a replacement for Bourne shell. This is also interpreted and cannot able to compile it. BASH shell can also be run on any terminal windows. So users can write commands and perform related actions. BASH shell is also used to read the commands which are written using shell scripts.
Ans: The process management system calls in Linux implements the following methods.
The commands which are used in System calls to get the Process id are.
Ans: It is more secure because of the following reasons.
Ans: As I said earlier, the kernel is the heart of the Linux operating system. It acts as a bridge between both hardware and software. For example, if software requests any hardware requirement, then the kernel transfers the data between software and hardware. Most of the Android mobile devices use the Linux kernel.
Ans: LILO can be abbreviated as a Linux Loader, this is a boot loader used for the Linux operating system. Most of the recent Linux versions use LILO, to boot up the operating system into RAM to start the operation.
Ans: The grep searches file patterns. The grep searches the relevant lines for a specific pattern in the output of another command.
Example:
$ cat tomcat.log | grep org.apache.catalina.startup.Catalina.start
12-Jan-2018 17:08:35.542 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 681 ms
Ans: The commands are.
vi filename: This command is used in creating a new file as well as modifying an existing file.
View filename: This command opens an existing file in read-only mode.
X: This command deletes the character which is under the cursor or before the cursor location.
dd: This command is used to delete the current line.
Ans:
pwd: The command stands for “print working directory”. It is a built-in command which displays the current working location, working path that starts with / and directory of the user. It displays the full path of the current directory.
ls: The command is used for listing all the files in the directed folder.
cd: The command stands for “change directory”. It is used for changing the directory on which you want to work from the present directory. To access a particular directory type cd followed by the directory name.
mkdir: The command is used for creating a new directory.
rmdir: The command is used for removing a directory from the system.
Ans: The ‘cd’ stands for change directory and is used in changing the current directory on which the user is working.
Syntax: $ cd {directory}
The purpose of using the “cd” command is as follows.
The options in change directory are.
cd~: This command brings you to the home directory.
cd-: This command brings you to the previous directory.
. : This command brings you to the parent directory.
cd/: This command takes you to the entire system’s root directory.
Ans: The features of the Linux operating system include.
Ans: The cat command in Linux is used for concatenating and printing the files. Users apply cat command to check the contents of the dependencies file or to confirm the version of an application which is already built locally.
Example:
$ cat requirements.txt
flask
flask_pymongo
Ans: A pipe is a form of redirection used in Linux. It is used in combining more than two commands and the output of one command can take as input to the next command.
Syntax:
command_1 | command_2 | command_3 | .... | command_N
Ans: The chmod command is used for changing the permissions of files and directories. There are three types of permissions, read, write and execute and are represented by numbers as shown below.
Syntax:
$ chmod options permissions file name
$ chmod [OPTION]... MODE[,MODE]... FILE…
$ chmod [OPTION]... OCTAL-MODE FILE…
$ chmod [OPTION]... --reference=RFILE FILE…
Ans: There are two commands used for getting exit from vi editors.
Ans: A system administrator grants the file permission using the “chmod” command. Following are the symbols used in writing the permissions.
It also includes the single letter permissions which denote.
Ans: The three different modes of vi editor are.
Ans:
Cron:
Anacron:
Ans: It is a shell command that is used for printing a list of current environmental variables which can run another process in another environment without any modification of the current environment.
Syntax: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
Options:
Ans: One file can be appended to another file by using the command cat file 2 >> file 1. The operator “>>” appends the output of the named file or creates the file if it is not created. There is another command cat file 1 file 2 > file 3 which appends two or more files to one.
Ans: It is the process of directing the data from one output to another or the output serves as input data for another process. There are three streams available in which input and output of the Linux environment are distributed.
3. Error Redirection: It is denoted as STDERR(2).
Ans: Shell in Linux operating system is a computer program this acts as an intermediate between the user and the kernel. Users can also communicate with the kernel with the help of programming codes, commands, and scripts on the shell. This shell accepts the human-readable commands and later converted them into the kernel understandable language.
Ans: The port numbers used for these services are.
Ans: There are two commands to check the ports listening in Linux Server.
Ans: Linux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are:
Bourne shell compatible, C shell compatible, nontraditional, and historical.
Ans: A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd.
Ans:
First, let me discuss the advantage of open-source;
Now it’s time to explain the disadvantage of open source:
Ans: A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP.
E.g. sort file | lpr ( sort the file and send it to printer)
Ans: There are 5 shells in Linux;
Ans: A stateless Linux server is a centralized server in which no state exists on the single workstations. There may be scenarios when a state of a particular system is meaningful (A snap shot is taken then) and the user wants all the other machines to be in that state. This is where the stateless Linux server comes into picture.
Features:
Ans: The following are the important component which made a Linux operating system;
Ans: Bash is a free shell for UNIX. It is the default shell for most UNIX systems. It has a combination of the C and Korn shell features. Bash shell is not portable. any Bash-specific feature will not function on a system using the Bourne shell or one of its replacements, unless bash is installed as a secondary shell and the script begins with #!/bin/bash. It supports regular and expressions. When bash script starts, it executes commands of different scripts.
Ans: Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table. Since this process is not alive, it cannot react to signals. Zombie state can finish when the parent dies. All resources of the zombie state process are cleared by the kernel.
Ans: The swap space is used when we need to run the Physical memory. This also helps users to move the RAM inactive pages to the Swap space. The swap space is available in two forms such as swap partitions, and swap files.
Ans: GUI in Linux operating system is a Graphical user interface. It is also considered as a type of human-computer interface which uses the Windows, images, icons, and menu bars. Most of the recent computer applications in electronic devices communicate with users through GUI. A graphical user interface is a combination of a graphical and textual interaction that can be used in the form of buttons, menus, and message boxes.
Ans: Each file or directory has 3 file permissions in Linux;
Ans: The main differences between BASH and DOS are as follows;
BASH | DOS |
BASH command is a case sensitive | DOS command is not case sensitive |
Under BASH the characters are directory separator and which acts as an escape character | Under DOS the characters are the command argument delimiter and are the directory separator |
BASH follows such no convention | DOS follows a name convention |
Ans: Symbolic links are shortcuts in windows. These links point to programs, codes, files, or directory. This link allows direct instant access to the entire pathnames.
Ans: Yes, it works on Linux; we can use this key combination to restart the system.
Ans: The hard links directly point to the physical file on a disk, and never on the pathname. Suppose if you remove or move the original file, the hard link will not break because the link itself is used a file, not the path where the file is stored in a directory.
Ans: Daemons are a kind of service which offers different functions that you can’t find them under the base operating system. The main tasks included are listening for a service request and let them act on these requests. Once the service is finished, it is then disconnected and waits for any further requests.
Ans: This virtual desktop is an alternative service to minimize and maximize the multiple windows on the currently running desktop. The main purpose of using a virtual desktop is to clear the desktop when you run one or more programs at a time. This enables users to shuffle between the desktops rather than minimizing/ restoring the programs.
Ans: The inode is a unique name given to any file or directory whereas process id is a unique name given to each process.
Ans: There are 5 process states in Linux;
Ans: The file permission groups are based on each file or directory, they are as follows;
Owner: The owner will have permission to access the file or directory; they will not impact any action of other groups.
Group: The file permission will be applied only to groups that are assigned to the file or directory
All users: This type of file permission will be applied to all the users on the system.
Ans: The Linux file system is used to store and handle the data. Without a file system, it becomes a very difficult task to know where the file begins from and where the file ends.
Ans: LVM means large volume management; it is nothing but a storage management device. With the help of LVM users can create, resize, or delete the partitions. LVM also increases the abstraction, flexibility, control, gather existing storage device, and allocates the logical units.
Ans: Umask = users for file creation mode. When you create the file, this offers the default file access permissions. Umask also specify a new restriction to the newly created file type.
Ans: To set the Umask permanently we have two options such as,
Ans: There are six different modes of the network bonding in Linux;
Ans: The directory name is lib/modules/kernel-version/, this is the directory where we can see the Kernel module, this stores all the valuable information about the compiled drivers. Using lsmod command users can see the installed kernel modules.
Ans:
Linux:
Windows:
Batch starts on 10th Mar 2021, Weekday batch
Batch starts on 14th Mar 2021, Weekend batch
Batch starts on 18th Mar 2021, Weekday batch