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.
Interested in learning Linux Join hkr and Learn more on Linux Training
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.
Become a UiPath Certified professional by learning this HKR Embedded Hardware Design Development Training !
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.
We have the perfect professional Linux Tutorial for you. Enroll now!
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.
Related Article : How To Install Kali Linux
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.
[ Related Article: Adobe CQ5 System Administrator Training ]
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,
Related Article : Linux File Permission
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:
Ans. Linux is an open-source popularly used operating system based on Kernel or Kernel distributed. It supports different hardware devices and platforms. Also, it offers a free and low-cost OS for users and is very popular among developers also. Linux is highly secure and we can install it on multiple systems at no cost.
The following are the important differences between Linux and Unix OS.
Linux
Unix
Ans. The kernel is the main component or the core part of the Linux OS. Further, it includes different modules and it manages all the important activities of the Linux OS.
Ans. Linux OS was developed by Linus Torvalds, a student at the University of Helsinki, Finland in 1991. The name is derived from the Linux Kernel. This is a type of software that allows users and apps to access devices to execute some functions.
Ans. In Linux, LILO refers to Linux Loader which is a boot loader or a boot manager used for the Linux OS. LILO is useful to boot or load the Linux OS into the main memory to begin the operations.
Ans. Linux Kernel is the important part and the heart of the Linux OS. It is basically responsible for all the actions in this OS and an interface between software processes and hardware.
You can understand this with an example; To play a song you have to start your default player. Then it sends a request to the kernel to play a song. The Kernel then contacts the hardware to get the permissions or to look for the hardware components. This is similar to that where you plugged any headset into a device. Moreover, Linux Kernel is used by many Android devices.
Ans. Bash in Linux OS is a command processor and a Unix shell written by Brian Fox. This is an updated version of Bourne Shell and is useful for the GNU project. Further, it is capable of reading and carrying out commands from the shell script. Also, users of Bash are allowed to write commands and cause actions.
Ans. CLI is a short form for the Command Line Interface that interacts with the computer program. It is a non-graphical and text-based interface to the system where the user can issue a command in the form of text lines. Thus, the interface (UI) receives the text lines and turns them into a command to the OS. Moreover, CLI can work much faster with great efficiency than other interfaces.
Ans. Linux OS is one of the open-source technologies released under the GNU General Public License. This is completely open to the users where they can easily download the file and change the code as they like. Further, it offers different types of options for users with enhanced security.
Ans. The following are the various drawbacks of the Open Source OS:
Ans. A shell is a computer program and a Linux CLI that performs like an interface between the kernel and the user. Users have options to write programs, commands, scripts, etc. on the shell to connect with the kernel. It receives human-readable commands and turns them into the language that Kernel understands.
Ans. There are five types of Shells in Linux:
Ans. The following are the various basic components of Linux.
Kernel: It is the major component of Linux that looks after all the OS actions and acts like an interface between hardware & software.
Shell: This is an interface between the user and the Kernel that hides the Kernel’s complexity. It receives commands from the user to perform certain actions.
GUI: It's a short form of Graphical User Interface. It offers a different way for the user to interact with the system.
Utilities: The utilities are the software OS functions allowing users to manage the system.
Application Programs: These are a set of functions built to perform certain tasks.
Hardware: This is a combination of various peripheral devices like HDD, RAM, and CPU that form the Hardware layer for Linux OS.
Ans. You can start the terminal by pressing the CTRL+ALT+T buttons or by making the terminal available in the menu search bar.
Ans. Swap Space is used when the physical memory or RAM is running out. When there is more memory requirement then it will move the inactive pages to the swap space. You can consider Swap space as a replacement for additional RAM.
Ans. GUI refers to Graphical User Interface which is an interface between the user & the system. It uses windows, icons, graphics, menus, etc., and these can be operated through a mouse/keyboard. Moreover, GUI is a communication tool with a user for many latest electronic gadgets. It generally combines graphics and texts for interaction and uses buttons, menus, message boxes, etc. Linux GUI has many components like Panels, Menus, Window Manager, Icons, Widgets, Dashboards, etc.
Ans. in Linux OS, every file or directory has 3 types of permissions:-
Such as:-
Ans. They are a set of dynamic values stored within the OS and affect the programs’ process on a system. These can be of different types. You can build, edit, save, and delete them and they also report about the system’s behavior.
Ans. It has another name Symlink that is redirected to another file or folder using its path in the system. This link is equal to the Windows Shortcut but not an actual file. If you remove the target file, the symbolic link to that file is deleted, not the actual file.
Ans. A hard link in Linux OS is a file stored on the hard drive. It points to a spot on the hard drive and represents a copy of the actual file. Even if you remove or change the file name, the Hard link still points to the underlying file in the system.
Ans. Redirection in Linux refers to changing the way of usual input and output devices. To redirect a file or a program, you can use metacharacters.
Ans. A Daemon is a process or a program that runs in the background without any human interaction. It accepts requests for service from other systems and it helps to observe and take care of subsystems. Also, ensures that the OS runs perfectly. Today, many operating systems use daemons in different forms.
Ans. The root account is a type of special user commonly given the name ‘root’. It by default can access all files and commands. The root user is different from the ordinary user. This user can perform many tasks like software installations, changing file permissions, etc.
Ans. A Virtual Desktop (VD) is useful as a user interface for managing multiple windows on your desktop computer. Further, it serves as an alternative for desktop issues. It's a kind of VM that generally runs a workstation OS using which an employee can do his tasks.
Ans. In Linux, you can find three kinds of modes in vi editors.
Ans. The Inode in Linux is a uniquely given number for all the existing files and the process id is a unique name automatically allotted to each process.
Ans. There are five process states in Linux OS.
Ans. A system call acts like an interface between the user program and OS. The various types of the process management system (PMS) call in Linux:
Ans. The following are the three user-based file permission groups for every file/directory in Linux.
Owner: The permission allows owners only to access the file or directory rather than affecting the other users’ actions.
All Users: These File permissions apply to all the system users.
Group: These file permissions apply only to the allotted file or directory group. The permissions will not affect the actions of other users.
Ans Linux file system is an arranged file collection on a disk drive that stores and manages the data. Without a file system, you cannot know about the starting and end of a file in the system.
Ans. In Linux, you can find the below file systems:
Ext, Ext2, Ext3, Ext4, JFS, ufs, ReiserFS, XFS, btrfs, ntfs and swap file.
Ans. In Linux, LVM refers to Large Volume Management that works like a storage management device. With this, users can build, resize, and remove various LVM partitions. It helps to enhance extraction, flexibility, and authority. Further, through the LVM tool, you can allocate disks, and clear and resize logical volumes.
Ans. In Linux, the term umask refers to the user-file-creation-mode mask. When the user creates a new file or folder, then this Linux command allows the user to set up a default file permission. Thus, the umask will mention some restrictions to the newly created file by the user.
Ans. If the umask command is used without any arguments then it will present the existing mask.
To set the umask permanently for a specific user, we can use these two types.
Hence, for example, if a user sets a umask to 0022 when he creates a new file. Then it would be built using 0644 permissions. Again, if you build a directory it will use 755 permissions. So, the user must need to minus the umask from the default 666 file and 777 folder permissions respectively.
Thus, the umask command is highly useful to set this mask or to present its current value to a user.
Ans. In Linux, Network Bonding refers to a process of merging two or many network interfaces into a single network interface. This bonding provides performance improvement and process repetition by increasing network bandwidth along with the output.
Even if you unplug or stop any interface, then no need to worry because the other interface will start working. Moreover, an interface’s behavior depends on the bonding method.
Ans. The following are the various modes of network bonding in Linux.
Ans. To check the default route and routing table, the following commands are useful.
Ans. The following two commands are available to check which ports are listening in Linux Server.
# netstat --listen
# netstat -l
Ans. The default run level in Linux OS can be altered using the ‘init’ command.
e directory lib/modules/kernel-version/ holds all the data about the compiled drives in the Linux OS. Using the “lsmod” command in Linux, we can also see the existing kernel modules.
Ans. The default run level in Linux OS can be altered using the ‘init’ command.
Ans. The method to share a directory using NFS is as follows.
First, you need to edit the config file and the ‘/etc/exports’ file. Then you need to make an entry like ‘/
Ans. This process is carried on for security purposes so that unofficial users can’t log in to the account. Therefore, we have a few different methods to lock the user account.
Ans. It is a basic command in Linux OS and is used to list all the files & directories available in the file system.zom
ls [OPTIONS] [FILES]
Utilizing the command without passing the arguments will list all the existing files in the existing working directory. Also, this command enables displaying all the files in alphabetical order.
Is
If you want to list particular directory files, then use the directory name in the syntax, such as:-
ls /etc
In Linux, you can also pass many directory names using the syntax, but splitting by giving space.
ls /etc /var /etc/passwd
Ans. The Tail command in Linux OS is useful to print the last N number of lines of the given data. But, by default, it prints 10 lines only.
The Syntax we use for Tail:
tail [OPTION]... [FILE]
The example of the Tail command is as follows:-
$ cat names.txt
Tableau
SQL server
Linux administration
Now, you can check the given syntax without providing any input.
$ tail state.txt
Ans. The ‘grep’ command is a type of filter useful for the global search for regular expressions.
The Syntax for ‘grep’ is:
grep [options] pattern [files]
Ans. The command ‘ps’ is useful to present the existing process status of the system. And it also shows the process IDs including other related data.
The Syntax we use is:
Ps [options]
Ans. The ‘env’ command is a shell command in Linux useful to print a list of existing environment variables. Further, it can run another process in another environment without any change or alteration of the existing environment.
Ans. The command ‘top’ refers to the Table of Processes in Linux OS. It is useful to present the system process. It also shows and updates the arranged process data.
Ans. The command ‘netstat’ is useful to present the network status and routing tables, interface statics, connections, and much more about the system.
Ans. The command ‘lsof’ refers to a List of files. Using this command we can know the file opened by any process.
#lsof
Ans. This command ‘chmod’ is used to control access to the scripts and to alter the permission of system files and directories. Therefore, we can see there are three different types of permissions available: read, write and execute. Also, they are displayed by numbers such as.
Ans. The ‘cp’ command in Linux is useful to copy files and directories from the system. Also, you can use it to back up files or directories in the system.
The Syntax we use: $ cp filename
Ans. The rm command is used to delete a file or a directory from the given command line. While removing any file or directory from the system, you must take care.
Syntax:
rm filename---
Command Description
Ans. The command ‘mkdir’ enables users to build directories in the Linux OS. Further, users can develop as many directories at once and can set the permissions to them for use.
Syntax:
mkdir [options...] [directories ...]
Ans. Using the command ‘rmdir’ you can delete each directory stated on the command line.
The syntax we use for rmdir:
rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories
Ans. To exit from the vi editor, there are two commands in use:-
Ans. The below-stated commands are useful to remove any data from a file in vi editors.
Ans.
The following are the different types of file content commands in Linux.
Ans. The following are the Linux Distributors out of many distros available.
Ans. The following important reasons behind the use of LINUX are listed out here.
Ans. Below are the most important features of the Linux OS.
Ans. The following points differ between Bash and DOS.
Bash
DOS
Ans.
Internal Commands: These commands are directly run by the shell and there is no other process to run them.
External Commands: These commands in Linux are run by the kernel and each command here owns a unique process id.
Ans. The process of communication between the child and parent process includes the use of sockets, pipes, messages queues, and more.
Ans. A Stateless Linux Server is a central server that doesn’t include any existing states on the working station. It may have outlines when a specific system’s state takes a snapshot. Then the user may require all other systems to be in that specific state only.
Ans. The command ip tables is helpful to block or allow traffic on a Linux host. It is like a network firewall that prevents some applications from receiving and passing on requests.
Ans. The pushd command in Linux saves the existing working directory within memory or stack so that we can get it back at any time.
Ans. The “du” command allows us to quickly check the disk usage or the number of blocks used for a file.
Ans. The command df -h represents the free space available in the file system. The df -i command represents the number of free inodes available in the file system.
Ans. W command: shows who is logged into the system in Linux.
Ans. SMTP refers to a Simple Mail Transfer Protocol, an internet standard useful for mail transmission.
Ans. We can use gunzip command to uncompress or decompress gzip files in Linux.
Ans. MD5, or Message-Digest Algorithm, is an encryption method or a helpful cryptographic protocol to encrypt passwords before they are saved. It helps in message authentication and content verification.
Ans. The following are the commands used for user management in Linux:-
Ans. The maximum length of a filename is 255 characters.
Ans. We use the command - dmesg to view Kernel Boot messages in Linux.
Ans. Linux Ping or Packet Internet Groper is the command useful to verify the connection status or network connectivity between the host & server.
Ans. Fstab refers to the filesystem table in Linux; a configuration table developed to make it easier to mount and unmount the file systems to a device.
Ans. It is an empty directory that is nameless in the Linux file system. It is similar to an attachment for other directories, such as files, drives, etc.
Ans.
We can use the following commands-
Batch starts on 24th Mar 2023, Fast Track batch
Batch starts on 28th Mar 2023, Weekday batch
Batch starts on 1st Apr 2023, Weekend batch