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.
- Linux Is Kernal
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.
- Firewall and Security
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.
- Recovery and Backup
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:
- The minimum granularity with Anacron is in days, while it is in minutes with Cron.
- any normal user can schedule the Cron job, while only a superuser can schedule the Anacron. A superuser is a distinct user account used for administration purpose. Based on the OS, the real name of this account might be an administrator, root, supervisor, or admin.
- Cron is perfect for servers, whereas Anacron is a perfect choice for laptops and desktops.
- Cron expects the system to be running and up, whereas Anacron doesn’t expect this all the time. In Anacron, when a task is scheduled and the system is down, it will perform the task when the system is up.
- when you want to execute a job at a particular minute and hour, Cron should be used, and when you to execute a job anytime, Anacron should be used.
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?
- Mode-0(balance-rr): based on Round-Robin policy, it is a default mode of network bonding in Linux. It provides load balancing and faults tolerance features. To transmit the packets, it uses round-robin fashion.
- Mode-1(active-backup): based on Active Backup policy, just one slave would act in the band and another one will act when the first fail. It offers fault tolerance.
- Mode-2(balance-xor): It groups a xor mode among the source and destination Mac address to offer fault tolerance.
- Mode-3(broadcast): it transmits everything in the interface slave and based on broadcast policy. You can use it for a particular purpose and it also offers fault tolerance.
- Mode-4(802.3ad): It is known as the dynamic aggregation mode, and make aggregation groups with the same speed. To select the slaves for outgoing traffic, it uses transmit hashing technique.
- Mode-5(balance-tlb): The outgoing traffic is based on the slave current load, and the slave receives the incoming traffic also. It is known as an adaptive transmit load balancing mode.
- Mode-6(balance-alb): this mode does not need any support to switch. It is also known as an adaptive load balancing mode.
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:
- GNOME = gnome-session
- FVWM = fvwm
- IceWM = icewm
- KDE = startkde
- BlackBox = blackbox
- Window Maker = wmaker
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 126.96.36.199 is your system’s IP address that the SSH access is required and after that the enter the command: ssh 188.8.131.52
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:
- LMD (Linux Malware Detect)
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:
- PASS_MIN_DAYS – States the minimum days allowed between password reset.
- PASS_MAX_DAYS – States the maximum days to use a password.
- PASS_WARN_AGE – States the days to give warning before a password expires.
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
- ‘-‘ for denying permission
- ‘+’ for adding permission
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:
- Hostname: This command is used to view the machine hostname (IP address and domain) and for hostname setting.
- ifconfig: used to manipulate and display network and route interfaces. It shows the configuration of the network. ‘IP’ is the ifconfig command replacement.
- Traceroute: It is a utility of network troubleshooting, used to find the hops needed for a packet for accessing the destination.
- Dig: used for DNS name servers query for any job related to the DNS lookup.
- Route: It displays the route table details and operates the IP routing table.
- Ifplugstatus: it tells if the network cable is plugged in or not.
- Ping: this command is used to identify if the remote server is accessible or not.
- netstat: It shows network links, interface statistics, routing tables. ‘ss’ is the netstat command replacement, used to get more data.
- Tracepath: It like a traceroute with a change that it does not need root rights.
- nslookup: This command is used to find query related to DNS.
- mtr: it combines track path and ping into a single command.
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.
- Through passwd command, disable or lock the password.
- Using nologin command to change the shell (/sbin/nologin).
- using chage command or usermod command to expire the account of user.
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: –
- Read: under this permission users can read the files or directory list
- Write: under this permission, users can write to the files to the directory
- Execute: under this permission users can execute a file or lookup any file in the directory
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:
- The ext3 file system is a higher form of the ext2 file system.
- After an unexpected system crash or power failure (a system shutdown), ext2 file system should be analyzed for constancy through the e2fsck program. It is a time-taking procedure and through this process, information on the volumes is inaccessible.
- ext3 supports journaling, it is one of the major differences among both ext2 and ext3.
- The journaling offered by the ext3 file system indicates that this type of file system check is not essential to perform after an unclean system shutdown. A consistency check only occurs in rare hardware failure while using ext3, for example, hard drive failures. after an unclean system shutdown, the recovering time of an ext3 file system not based on the file system size or the number of files. But it is based on the journal size used to preserve constancy. The default size of the journal takes a couple of seconds to recover, based on the hardware speed.
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: –
- Edit mode – this mode allows you to edit your text –
- Command mode – this mode is where you start in-
- Ex mode – this mode wherein you interact with vi editors with commands for file processing
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.
- You can use some Linux command to check the status of memory
- If you want to display output in GB use free -g
- If you want to display output in MB use free -m
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.
- Solid Community: before opening the files the users of the Linux OS accomplish them. It also helps them to make their system more secure and restrict vulnerabilities.
- Diverse Working Environment: there are different working environments are present in Linux OS such as Debian, Linux Mint, Arch, etc. all of the environments are protected from virus.
- The benefit of accounts: only a few users are allowed to have access the Linux OS. Therefore, the systems are secure and protected from virus attacks, and in case of an attack, it affects only a few files.
- Iptables: Linux OS uses the Iptables, in order to check the system’s security circle.
- Linux Recording: all of the log histories are maintained through this and you can view all the system files details easily.
- Few User: Because of the high-security measures of the Linux OS, its users are fewer comparing with other OS.
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.
- Security: Linux is a reliable server, that provides the users with a high level of security. If you are using the Linux operating system, it would be easier for you to avoid malware and virus. This OS doesn’t let the attacker make any changes in the system until the root user logged in the system.
- Compatibility of Hardware: you can use the Linux on any hardware, without any restrictions. It efficiently uses all the resources of the system.
- High Stability: It is a steady OS and does not result in the crashes, it runs quickly as if you have just installed it.
- Easy to Operate: Linux is easy to work with and you can easily install it on your system because all the Linux variants have their own software sources. you can set automatic updating or occasionally update the system in just a few clicks.
- Open Source: you can use the Linux OS free of cost as it is under Free and Open Source Software (FOSS)
68. Name some features of the Linux OS?
Some of the major features of Linux OS are as follow:
- Open Source: the source code of this OS is freely available, and it is a community-based development project.
- Multiprogramming: you can run multiple applications or program simultaneously.
- Security: It offers authorization, authentication, and encryption to make your data more secure.
- Portable: you can easily carry it in memory cards and pen drives. Linux OS can be operated in different types of devices likewise.
- Multi-User: Multiple users can use applications, ram and execute programs simultaneously.
- Shell: Linux OS has a distinct interpreter program where you can run your commands and programs.
69. Name some major Stateless Linux Server’s features?
Some of the major features of Stateless Linux Server are as follow:
- It stores every system’s prototype.
- It stores the home directories.
- It stores the snapshot was taken.
- It uses LDAP that holds information concerning which snapshot run on which system.
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:
- exec(): for a new program execution
- exit(): for exiting the process
- fork (): for creating a new process
- wait(): Wait until the execution of the process is completed
And the System Calls used to get Process ID are:
- getppid():- get the unique id of the parent process
- getpid():- get the unique process id
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.
- /proc/meminfo: a common method to determine usage of memory is to read /proc/meminfo file. Such as: ‘$ cat /proc/meminfo’
- Top command: This next command to identify the memory usage and also monitors the usage of RAM is Top command.
- Free command: it is one of the easy and simplest ways to use command and to identify the overall usage of memory usage. For instance: ‘$ free –m’, the option ‘m’ shows data in MBs.
- Vmstat: use this command to get the memory usage statistics layout. For instance: ‘$ vmstat –s’
- Htop: This command displays the overall usage of memory with other facts.
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.
- Output Redirection: for output redirection, we use the ‘>’ symbol and it is numbered as (1). Therefore it is signified as STDOUT(1).
- Input Redirection: for input redirection, we use ‘<’ symbol and it is numbered as (0). Therefore represented as STDIN(0).
- Error Redirection: It is represented as STDERR(2).
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.