Are you searching for Linux Administrator job? If yes, then this article is for you. You can be a pro in Linux Administration but passing the interview is a tough challenge and should prepare for it very well to pass it out smoothly. In this article, I am sharing with you some advanced Linux administration interview questions that you are more likely to encounter during your interview. These Linux interview questions and answers would help you to get an idea of what your interviewer is going to ask you in the interview. This article included Linux interview questions for experienced and beginners. Surprisingly, most of the times experienced professionals also have difficulty to pass the interview because of not knowing the definition, syntax and commands of the Linux operating system.
I believe these Linux administrator interview questions and answers would be enough for you to successfully pass your interview. The Linux administrator interview questions can be basic or advanced level based on your experience and job description for which you are applying. We have divided Linux based interview questions into different categories such as Linux basic interview questions and answers, Linux advanced interview questions, Linux administration interview questions, Linux commands interview questions and answers, Linux technical interview questions. Linux is a vast field and you have to keep studying this throughout time to do well in the interviews.
Read out the complete article to find out the most likely Linux OS interview questions you are expected to encounter.
Linux Basic Interview Question
1. What is Linux?
Linux is an open-source operating system based on Linux Kernel. You can run Linux on diverse hardware platforms. It offers its users a low-cost and free operating system. It provides a user-friendly atmosphere and you can easily make modifications in your source code.
2. What are the main components of Linux?
Some of the main components of Linux are Kernel, shells, GUI and system libraries, application program, and system utilities. The kernel maintains all operating system’s functions along with virtual memories and processes, while system libraries performing tasks that communicate with the kernel. Furthermore, GUIs and shells are the Kernel’s interface, accountable for with user’s interaction and execute functions of the kernel. In Linux, application programs are involved with definite tasks that are instructed by the user.
3. Do you know about Unix?
The source code of Unix is not open, it is used for Command Line Interface (CLI) and it is not transportable. It has an inflexible hardware environment and you have to install it on every machine available. Moreover, it works in a server system, mainframes and high-end computer and HP-UX, BSD, AIS, Iris are the numerous types of Unix. Its installation is bit expensive that needs specific hardware and some supported file systems are xfs, gps, js, zfs, vxfs, and hfx
4. What is LILO?
LILO stands for Linux Loader. It is a Boot Loader in Linux that loads Linux OS into the memory to start execution. Many computers come with boot loaders for some Mac OS or Windows versions. You have to install a boot loader like LILO to use the Linux OS.
Once your computer is started, some early tests and transfers control are conducted by BIOS to the Master Boot Record. LILO loads the Linux operating system and executes it. The benefit of using LILO is that it permits fast Linux OS boot.
5. What is BASH?
Bash is a Unix command processor and shell written for the GNU project by Brian Fox. This software is totally free to use and acts as a Bourne Shell’s replacement. It is not compiled and an interpreted process that can be executed in the terminal window. This lets users writing commands and cause actions. Bash is also proficient of commands reading from scripts of the shell.
6. What are the advantages of Linux?
Users can get a lot of benefits from Linux as far as the stability, efficiency, compatibility, flexibility, cost and security is a concern. However, Linux is a bit complicated but any user can get over it and can have efficient service. Linux Server Configuration can be changed very fast easily, and once you have done this, reliable service is certain. Proper server configuration is also mandatory to secure your server from hackers.
Being an open-source OS, Linux is more flexible and also compatible with many applications and software. It provides safety for private computers by locking up their OSs. Finally, you don’t need to pay any license fee for Linux, though; you can pay some advanced software to improve your experience with Linux.
7. What is the maximum length for a filename in Linux?
In Linux, every file name can have a maximum of 255 characters. This limit cannot eliminate the pathname, so, therefore, the filename and pathname should we exceed 255 characters. The interviewer mostly asks this kind of basic Linux interview questions and confuse the applicant and ask to mention length with pathname. So, you have to be prepared for Linux scenario-based interview questions before the interviewer asks you more.
8. Why Linux and Unix are different?
Linux is a replica for Unix. Linux can be considered as UNIX if you consider Portable Operating System Interface standards.
All Linux distributions include GNU utilities, GUI system, management & installation tools, Editors (vi), GNU C/C++ Compilers, and numerous applications such as Firefox, OpenOffice.
In UNIX OS everything comes from one vendor.
Linux offers open-source Netfilter and IPTables firewall tool to defend desktop and server from the hackers and crackers. UNIX OS comes with its own products of the firewall.
Linux and UNIX have their own set of tools for data backup to and other backup media. Though, both UNIX and Linux have some tools, for example, restore, tar, and cpio, etc.
9. What is Swap Space?
Swap Space is an extra space used by Linux that holds concurrently running programs temporarily when the RAM does not have sufficient space for holding the programs. While running a program, it is located in the RAM so that the processor can quickly search the data. If you are running programs than these programs are kept by RAM, and then stored in Swap Space. Now, processor search data from Swap Space and the RAM. Swap Space is used by Linux as RAM extension.
10. Tell me about netstat Command
Its exhibitions routing tables, interface statistics, network connections. ‘ss’ is the netstat replacement command that is used to get additional info.
11. What is the GUI?
GUI stands for Graphical User Interface. It is an interface used by users to interact with a machine that uses windows, menus, images, and icons that can be operated by using a mouse. Many modern applications in electric devices interact with the user via GUI. It is a combination of textual and graphical interaction that uses, buttons, message boxes, menus, etc.
12. What is CLI?
CLI stands for Command language Interpreter. It is mainly used to interact with the computer program, where the user issues a command in text lines. It also communicates with the computer terminals; the interface receives the text lines and changes them as a command to the OS.
13. Tell me about Linux Kernel
The kernel is said to be the heart of the OS. It is actually a bridge between hardware and software. If the hardware is requested by the software, then kernel carries the data between hardware and software. For instance, if you play a song you have to start your player, it requests kernel to play a song, the kernel will communicate with hardware to get the permissions or to search for the components of hardware, if you connect the device to any headset. Mostly, Android phones use Linux kernels. Of course, you can use the kernel to edit, as it is released under General Public License.
14. Describe the root account.
The root account is similar to the systems admin account and lets you control the system completely. Here you can maintain and create accounts of the user, assigning different approvals for every account. every time you install Linux, the root account as your default account.
15. Why the GNU project is important?
There are a lot of advantages are associated with free software, for example, the liberty to run programs for any reason and freedom to modify and study a program according to your requirements. It allows you to reallocate software copies to other people, and the freedom to improve the overall software and released it for the public.
16. Which Linux Distro, you think is the best?
There are many Linux distros accessible in the market. Many of them are more popular amongst the users and work efficiently to serve the purposes. The famous Linux distributions are Linux Mint Cinnamon Ubuntu, Elementary OS, Zorin OS, Manjaro Linux and Linux Mint Mate. These distributions are very proficient of doing specific functions.
As far as my experience with these distros is a concern, I find Ubuntu the best and most efficient distribution. I like it the most because it is very user-friendly and simple to use.
Advanced Linux Interview Questions
17. Differentiate between Cron and Anacron?
Some of the major differences between Anacron and Cron are as follow:
18. Tell me about the role of case sensitivity in the use of commands?
Linux is a case sensitive operating system. Case sensitivity is an important aspect of Linux because it is used to displaying diverse answers for the similar commands based on the format of commands you are entering every time. As far as the case sensitivity is a concern, the command will be the same but difference occurs when you use lowercase and uppercase letters.
For instance, cd, CD, Cd have different outputs because they are different commands.
19. What are the different modes of Network bonding in Linux?
20. How can you improve the password file security in Linux?
The password file located in the test file ‘/etc/passwd’, in which Linux typically keeps its details about a user account, with one-way encrypted passwords. Though you can also access this file by using different tools, that can also create some security issues.
To lessen this risk, you have to make some shadow password format to save the details of your account in a file /etc/passwd as in the traditional technique but the password should be stored as a single character, i.e. ‘x’, it is not the real password that is stored in the file. In the meantime, second file /etc/shadow has an encrypted password, with other related information, for example, the expiration date of password, etc. Importantly, the last file is only readable by the root account, and thus it diminishes the risk related to security.
21. How would you restore the original kernel system files, if your FTP Server is hacked?
In this case, we cannot use a tape backup device to restore the entire OS. So, you have to reinstall the main OS and then restore the user data and system configuration files from the tape backup device.
22. Why will you avoid Telnet to remotely administer a Linux system?
As far as communication is a concern, Telnet uses the most uncertain technique. It transmits data across the network in plain text and using the network tool anybody can find out your password. It comprises the login credentials passing in text format, i.e., someone on the network running a sniffer can find the information, this person can get control of your device in seconds by Telnet login session eavesdropping.
23. Which command is used to check the disk space, a number of files, and quota defined by the user?
To check the user’s defined quota status, with the number of files and the disk space used, we can use the repquota command is used. Using this command, you will get the user’s quota summary, such as, how much files and space are there for a user. In Linux, every user has a defined quota. This is primarily done for security reasons as it confines unwanted access to the files. The quota can be given to a group of users or a single user.
24. How would you change the window manager in Linux?
We can use the /.xinitrc file change the window manager that will be used when login to the X window session. The dot (.) is an indicator that the file is hidden. It means that this file will be absent while carrying out a normal listing in the directory. To set up a window manager, you have to save the following command in the file:
Exec window manager
After that, you have to save the file. Doing this, whenever we run a startx a window manager opens, and it turns out to be the default. Here are some of the commands used for starting window managers and some desktop environments:
25. In Linux, how are shadow passwords given?
For providing the shadow passwords, we use pwconv command in Linux. The main purpose of giving Shadow passwords is to improve the overall security of the system. This command makes a file /etc/shadow and all passwords are changed to ‘x’ in /etc/passwd file.
Primary, the shadowed file entries, don’t exist in the core file, are eliminated. After that, the shadowed entries in the main file without ‘x’ as the password are updated. Any shadowed entries missing are added. Lastly, in the main file passwords are substituted with ‘x’. These are the programs that can be used for initial conversion and to shadowed file update if the core file is updated by hand.
26. What is the virtual desktop and how we can share a program across diverse virtual desktops in Linux?
Basically, a virtual desktop presents a substitute to maximizing and minimizing windows. Rather than of restoring or minimizing programs, virtual desktops let shuffling among desktops with different program windows. Most of the times it is important to share a program across various virtual desktops. For this, you have to go to the program window’s upper left corner and click on an icon looks like a pushpin. The application will pin; you can access it from different virtual desktops.
27. How to remote login with SSH?
There are many ways you can access a remote computer; it is more preferred to use the SSH (Secure Shell) protocol. In this protocol public-key, cryptography authentication technique is used for ensuring secure communication among hosts. If you want to use SSH command, it is important for the user to define the server by inserting its IP address. If 18.104.22.168 is your system’s IP address that the SSH access is required and after that the enter the command: ssh 22.214.171.124
Similarly, you can also specify the username as ssh email@example.com
SSH lets data compression and also transfer graphical commands through X11. When correctly configured, the SSH protocol provides a secure line that is proficient of defending itself against man-in-the-middle attacks and DNS spoofing.
28. How to check Rootkit infections in Linux.
A Rootkit is an advanced kind of malware that can cause a lot of security problems and in some cases, it cannot be detected by an average antivirus program. Hence, you should use advanced anti-spyware tools to check if there are any Rootkit infections in your Linux OS. The rkhunter is a famous anti-spyware tool used for this purpose.
You can also install Rkhunter from the repository of software through instructions of package management of the distribution. The users of Ubuntu and Debian can use the (sudo) apt-get install rkhunter command although Red Hat-based distros can use the commands like yum or dnf.
Some of the famous notable security tools to check rootkit infections in Linux are as follow:
29. In Linux, How can you setup Password Aging?
In Linux, the system administrators use chage command to apply password ageing. This command is used to modify the number of days among resets of a mandatory password. The /etc/login.defs file is accountable for managing the configuration in the system. It can be edited for:
Linux System Administration Interview Questions
30. As a Linux Admin, how to check CPU stats and memory stats?
By using the vmstat and free commands, you can display the virtual and physical memory stats, correspondingly. Through sar command, you can see the CPU usage and other statistics.
31. In which shell a Linux Administrator assign to a POP3 mail-only account?
A POP3 mail-only account is assigned by Linux Administrator to the /bin/false shell. Though, when you assign a bash shell to a POP3 mail-only account provides login access to the user that can be avoided. You can also use /bin/nologin shell in this case. When you don’t want to provide user shell access, this is the shell offered to the user. the shell cannot access by the user, and it also no accept the shell login on the server like in Telnet. It is primarily intended for the shells’ security.
POP3 is essentially used for mail-to-mail programs downloading. Thus, for the prohibited emails’ downloading on the shell, the account is assigned to /bin/nologin shell or the /bin/false shell. These shells are quite similar as they perform similar functions the similar work of rejecting shell’s user login.
The major difference among these shells is that the false shell displays the incorrect code and unfamiliar coding while any user logged in it, although the nologin shell only says us that no such account is accessible. Thus, Linux mostly uses the nologin shell.
32. In Linux, how permissions are granted?
The file owner or a system administrator can grant permissions by using ‘chmod’ command. Some of the symbols that you can use for permission writing are as follow
Permissions can also include a single letter denoting
g: group; o: other; u: user; w: write; r: read; a: all; x: execute.
33. Name some troubleshooting and Linux networking commands?
All computers are linked to network externally or internally for the aim of information exchange. Network configuration and troubleshooting are some of the essential elements of network administration. The networking commands allow you to rapidly troubleshoot issues related to the connection with another system, check another host response, etc.
A network administrator upholds network of a system including network troubleshooting and configuration. Some commands with their description are mentioned below:
34. What is umask?
unmask stands for user file creation mode. In this command, whenever a user makes any file, it has default permissions for the file. Thus, unmask will agree on a few limitations to the file created (it manages all the permissions of file).
35. Where the kernel modules are located?
In the Linux system, complete information about compiled drives is stored in lib/modules/kernel-version/ directory. The lsmod command is used to see the kernel modules installed.
36. How to use nfs to share a directory?
For sharing a directory through NFS, first, you have to edit the ‘/etc/exports’ and configuration file and insert an entry such as the name of directory ‘/’. Now you can restart an NFS service.
37. In Linux, how you can lock user account?
To maintain the security of the user account the locking user account is done so the unauthorized users cannot access your account. Following are some of the methods, you can lock a user account.
38. How to switch from one desktop environment to another, like KDE to Gnome switching?
Let’s suppose when we have installed two environments, log out from the graphical interface. You can see the login screen, enter login ID and password and select the type of session you want to load. This is the default choice until you change it.
39. In Linux, how many permissions are there?
Following are the 3 kinds of permissions under Linux: –
40. To install Linux, what is the minimum disk partitions needed?
For installing the Linux, you need a minimum of 2 partitions. One partition will be usedas a local file system. This comprises files of services and applications, files of the operating system and user files. Another partition is used as Swap Space that is a prolonged memory for RAM.
41. In Linux, how you copy a file?
To copy a file in Linux, you can use the cp command. The syntax for cp command is:
$ cp <source> <destination>
For example, if you want to copy a “questions.txt” file from the directory /Linux/interview to /new/linux, then the following command will be used:
$ cp questions.txt /linux/interview /new/linux
42. Tell me the difference between ext3 and ext2 file systems?
Some of the major differences between the ext3 and ext2 file systems are as follow:
43. What is /proc file system?
The /proc file system is a virtual file system that offers comprehensive information about hardware, Linux Kernel, and processes running. The files under the /proc directory are also known as the virtual files.
Meanwhile /proc comprises virtual files, called a virtual file system. The virtual files have very exclusive abilities. Many of them are recorded as zero bytes in size. Some of the virtual files for example /proc/meminfo, /proc/interrupts, /proc/partitions and /proc/mounts, offers an up-to-the-moment sight for the hardware of the system. Others, like the /proc/sys/ directory and the /proc/filesystems file, offer interfaces and system configuration information.
Linux Shell Is A User Interface for Executing the Commands
44. When using vi editor, what are the different modes?
Following are three modes under vi editor: –
45. Can we use shortcuts for a long pathname?
Yes, we can use shortcuts for a long pathname. You can use a filename expansion feature for doing this using a TAB key. For instance, you have a path called /home/snowman/assignments directory, you will type the following command: /ho[tab]/snow[tab]/assi[tab]. This, though, accepts that the path is exclusive and this feature should be supported by shell.
46. Tell me about grep command?
The grep command uses pattern-based searching. It also makes use of parameters and options that are stated with the line of command and applies this pattern in searching the mandatory output of the file.
47. If a command issued gave a different result from the last time, what is the possible issue?
One of the major reasons for getting changed outputs from the same command is most possibly because of the case sensitivity issues. As we know that Linux is case sensitive OS, a command used previously might use a different format for cases. For instance, in order to list files in the directory, you have to type ls command, not LS. If you type the LS, it will show an error message and it may produce a different result, in case there is another program exist with LS name that performs a totally different function.
48. Tell me about the contents of /usr/local
/usr/local comprises files installed locally. This is an important directory in the environment where files have to keep in a network. Typically, files locally-installed go to /usr/local/lib, /usr/local/bin, etc.). Another application of directory is its usage for software packages, or software not shipped formally with the distribution.
49. How to stop an ongoing process?
In the system, each process is recognized by a unique pid or id of the process. You can also use the kill command after the pid for the termination of the ongoing process. Use kill 0, if you want to terminate all process simultaneously.
50. In the command line prompt, how you can insert comments?
For creating the comments, you have to type a # symbol before the text of an actual comment. This tells the shell to totally overlook what comes after this. For instance, “# This indicates a comment and here the shell will ignore.”
51. Tell me about command grouping and its working?
In order to group commands, you can use parentheses. For instance, you want to send the time and date with the file contents named OUTPUT to a second file “DATES”, the command grouping can be implemented as follows: (date cat OUTPUT) > DATES
52. Can you identify, what is wrong with following commands?
a) ls -l-s
b) ls – s Factdir
c) cat file1, file2
a) there must be a space between the options: ls -l -s
b) no space should be among option label and hyphen: ls –s Factdir
c) don’t use commas for separating the arguments: cat file1 file2
53. How to calculate the folder size?
You can use du –sh folder1 command to calculate the folder’s size.
54. Which command you will use to find the status process?
The ps ux command will be used to find the status of any process.
55. How will you check the status of memory?
Following are the three ways you can check the memory status.
56. How you can color the Git console?
You can use the git config—global color.ui auto command to color the Git console. In the command, the variable color.ui sets the default value for a variable i.e. color.grep and color.diff .
57. In Linux, how to append one file to another?
In Linux, to attach a file to another, cat file2 >> file 1 command can be used. The operator >> attaches the file output or make the file if not exist yet. On the other hand, if you use the cat file 1 file 2 > file 3 commands, two or more files will be attached to one.
58. How to use Terminal to find a file?
You can use find. –name “process.txt” command to find a file. It will search in the directory for a file named as process.txt.
59. How to create a folder using Terminal?
You have to use the mkdir command, to make a new folder. It will look like: ~$ mkdir newfolder.
60. How to view the text file using Terminal?
For viewing the text file, you have to go to a folder where text files are placed by using the cd command and after that type less filename.txt.
61. How can you enable curl on Ubuntu LAMP stack?
To allow curl on Ubuntu, you have to install libcurl, after completing the following command sudo service apache2 restart or sudo/etc/init .d /apache2 restart.
62. How to enable root logging in Ubuntu?
Following is the command that would help you to enables a root logging is:
#sudo sh-c ‘echo “greater-show-manual-login=true” >>/etc/lightdm/lightdm. conf’
Linux Technical and Networking Interview Questions
63. What is Stateless Linux Server?
Stateless Linux Server is a centralized server without any states exists on the working station. It might have situations when a specific system’s state takes a snapshot and the user needs all machines to be in a specific state.
64. Why do you think Linux is secure than other OS?
As you know that Linux is an open-source OS, currently it is growing rapidly in the field of technology. Some of the main reasons why Linux is safer as compared with other OS are as follow.
65. In Linux, what is the tail command?
Using the tail command, you can display the last portion of any file. Usually, users don’t require to troubleshoot every logline. As an alternative, you can check what is your log is saying about your application’s current request.
For Example, you can write the tail command as:
$ tail -n 100 /var/log/httpd/access_log
66. In Linux, what is cat command?
The cat command is used to print and concatenate files in Linux. This command can be used to check the dependencies file contents or to settle the application version that you have now locally built.
You can write the cat command as follow:
$ cat requirements.txt
67. Why should we use LINUX?
There are some of the major reason why Linux is an effective and efficient operating system.
68. Name some features of the Linux OS?
Some of the major features of Linux OS are as follow:
69. Name some major Stateless Linux Server’s features?
Some of the major features of Stateless Linux Server are as follow:
70. What is Zombie Process?
The Zombie process execution is completed but data exists in the table of the process. It happens for the child process as the parent process requires to read the status of the child process. When it is done using the wait system call, the zombie process is the exit from the table of process. It is called Zombie Process
71. In Linux, what is the Process Management System Calls?
The System Calls to handle the process are:
And the System Calls used to get Process ID are:
72. In Linux, Do the Ctrl+Alt+Del key combination work?
Yes, this key combination work on Linux. Like Windows, this key combination can also be used to restart a system. The major difference is that you won’t get any message for confirmation and so, it results in an instant reboot.
73. In Linux, how would you refer to the parallel port where devices like printers are linked?
While in Windows you imply the parallel port as the LPT port, in case of Linux you imply it as /dev/lp. In Linux, LPT1, LPT2 and LPT3 be implied as /dev/lp0, /dev/lp1, or /dev/lp2.
74. Are drives like floppy drives and hard drive signified with letters of the drive?
No. In Linux, each device and drive have diverse designations. For instance, floppy drives are implied as /dev/fd0 and /dev/fd1. On the other side, the hard drives IDE/EIDE are implied as /dev/hda, /dev/hdb, /dev/hdc, etc.
75. How the total memory used by LINUX can be determined?
It is very important for you to check the overall usage of memory to realize whether the user can access the resources or the server are acceptable. There are five methods that can be used by Linux to determine the total memory usage.
Following are the method that you can use to identify the overall usage of the memory.
76. Explain Redirection?
Redirection is the process of data directing from one output to another or in some cases when the output becomes an input for another process. There are three streams available where Linux environment input and output are distributed.
77. What is the role of Kudzu?
Red Hat Linux execute a hardware discoverer known as Kudzu. It is used to identify any new hardware. Kudzu resets the serial port while trying to find a serial port. This terminates the serial console. You can also configure it from the file as follow:
Kudzu can be prohibited from hardware resetting, by configuring the parameter SAFE to ‘yes.’
78. In Linux, what does an “idle” CPU Process Do?
Once you have completed all the functions and the CPU is completely free, it is a state known as an idle CPU process. As we know that all programs running in the system take some time to execute in the CPU. Though; when all the programs are done, the CPU becomes idle. The idle CPU process reduces the overall consumption of energy and keeps the background engine dynamic.
79. How to Calculate Load Average in Linux?
The load average is calculated through the decimal number in Linux, starting from 0.00. The load average suggests the number of programs waiting for their turn to be run on the system. You cannot instantly get the load average; though, later it appeared at a specific moment. The status would be one-minute average, five-minute average, and fifteen minutes average.
80. In Linux, how to combine two lines from two sorted files?
In Linux, you can combine two lines from two sorted files by using the following command: comm file1 file2
In this article, you will get Linux-based interview questions and answers for different categories such as Linux interview questions for freshers, Linux server admin interview questions, interview questions on Linux commands, Linux networking interview questions and answers, etc. this article is an ultimate guide for you to prepare for your Linux interview.
I hope the knowledge, I have shared in this article is useful for you to do well in your interview. Do share this article in your circle if you find it helpful.
If you have some additional questions in your mind concerning the Linux OS, feel free to ask me in the comments section.