Top 80 Linux Interview Questions: Cracking the Code

24 min read

Are you searching for a 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 time experienced professionals also have difficulty passing 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 will 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 the 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, and 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 the complete article to find out the most likely Linux OS interview questions you are expected to encounter.

Table of Contents

Linux Basic Interview Question

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 programs, and system utilities. The kernel maintains all the operating system’s functions along with virtual memories and processes, while system libraries perform 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 the 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 computers, and HP-UX, BSD, AIS, Iris are the numerous types of Unix. Its installation is a bit expensive and 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 bootloaders for some Mac OS or Windows versions. You have to install a bootloader like LILO to use the Linux OS.

Once your computer is started, some early tests and transfer 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 free to use and acts as a Bourne Shell’s replacement. It is not compiled and is an interpreted process that can be executed in the terminal window. This lets users write commands and cause actions. Bash is also proficient in 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 stability, efficiency, compatibility, flexibility, cost, and security a concerned. However, Linux is a bit complicated but any user can get over it and have efficient service. Linux Server Configuration can be changed very fast and 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 for 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 exceed 255 characters. The interviewer mostly asks this kind of basic Linux interview questions and confuses the applicant and asks to mention length with pathname. So, you must 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 of 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, and OpenOffice.

In UNIX OS everything comes from one vendor.

  • Firewall and Security

Linux offers open-source Netfilter and IPTables firewall tools to defend desktops and servers from hackers and crackers. UNIX OS comes with its product the firewall. 

  • Recovery and Backup

Linux and UNIX have their own set of tools for data backup 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 then these programs are kept by RAM, and then stored in Swap Space. Now, the processor searches data from Swap Space and the RAM. Swap Space is used by Linux as a RAM extension.

10. Tell me about Netstat Command

It exhibits routing tables, interface statistics, and 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 the Linux Kernel

The kernel is said to be the heart of the OS. It is a bridge between hardware and software. If the hardware is requested by the software, then kernel carries the data between the 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 the hardware to get the permissions or to search for the components of the 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 for 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 associated with free software, for example, the liberty to run programs for any reason and the 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 release it for the public.

16. Which Linux Distro, do 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 in doing specific functions.

As far as my experience with these distros is concerned, 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

Advanced Linux Interview Questions

17. Differentiate Between Cron and Anacron

Some of the major differences between Anacron and Cron are as follows:

  • 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 purposes. 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 display diverse answers for similar commands based on the format of commands you are entering every time. As far as the case sensitivity is concerned, the command will be the same but the 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 fault tolerance features. To transmit the packets, it uses a round-robin fashion.
  • Mode-1(active-backup): based on the Active Backup policy, just one slave would act in the band and another one would act when the first failed. It offers fault tolerance.
  • Mode-2(balance-xor): It groups an xor mode among the source and destination Mac address to offer fault tolerance.
  • Mode-3(broadcast):  it transmits everything in the interface slave and is 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 makes aggregation groups with the same speed. To select the slaves for outgoing traffic, it uses the transmit hashing technique.
  • Mode-5(balance-tlb): The outgoing traffic is based on the slave’s 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 is 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, the second file /etc/shadow has an encrypted password, with other related information, for example, the expiration date of the 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 concerned, 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, and 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, several 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. 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 to change the window manager that will be used when logging into 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 the/etc/passwd file.

Primary, the shadowed file entries, that 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 shadowed file updates 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?

A virtual desktop presents a substitute for maximizing and minimizing windows. Rather than restoring or minimizing programs, virtual desktops let shuffling among desktops with different program windows. Most of the time 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 that 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 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 the SSH command, the user needs to define the server by inserting its IP address. If 181.248.101.32 is your system’s IP address SSH access is required and after that enter the command: ssh 181.248.101.32

Similarly, you can also specify the username as ssh username@181.248.101.32

SSH lets data compression and also transfers graphical commands through X11. When correctly configured, the SSH protocol provides a secure line that is proficient in 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 for 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 follows:

  • ClamAV
  • Lynis
  • Chkrootkit
  • LMD (Linux Malware Detect)

29. In Linux, How can you set up Password Aging?

In Linux, the system administrators use the change command to apply password aging. 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 a warning before a password expires.

Linux System Administration Interview Questions

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 the sar command, you can see the CPU usage and other statistics.

31. In which shell is a Linux Administrator assigned to a POP3 mail-only account?

A POP3 mail-only account is assigned by the Linux Administrator to the /bin/false shell. However, 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 be accessed by the user, and it also does not 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 the shell’s user login.

The major difference among these shells is that the false shell displays the incorrect code and unfamiliar coding when any user logs in it, although the nologin shell only tells 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 the ‘chmod’ command. Some of the symbols that you can use for permission writing are as follows

  •  ‘-‘ 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 the 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’s response, etc.

A network administrator upholds the 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 the 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, and routing tables. ‘ss’ is the netstat command replacement, used to get more data.
  • Tracepath: It is like a traceroute with a change that it does not need root rights.
  • nslookup: This command is used to find queries related to DNS.
  • mtr: it combines track path and pings 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 the 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 a user account?

To maintain the security of the user account the locking user account is done so that unauthorized users cannot access your account. Following are some of the methods, you can lock a user account.

  1. Through passwd command, disable or lock the password.
  2. Using nologin command to change the shell (/sbin/nologin).
  3. using chage command or usermod command to expire the account of the user.

 38. How to switch from one desktop environment to another, like KDE to Gnome switching?

Let’s suppose that we have installed two environments, and log out from the graphical interface. You can see the login screen, enter your 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 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 are 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 which is a prolonged memory for RAM. 

41. In Linux, how do you copy a file?

To copy a file in Linux, you can use the cp command. The syntax for the 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 follows:

  • The ext3 file system is a higher form of the ext2 file system.
  • After an unexpected system crash or power failure (a system shutdown), the 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 failures while using ext3, for example, hard drive failures. after an unclean system shutdown, the recovering time of an ext3 file system is 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, offer 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, if 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 the 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 Linux is case sensitive OS, a command used previously might use a different format for cases. For instance, to list files in the directory, you have to type the 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 that exists with an LS name that performs a 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 be kept in a network. Typically, files locally-installed go to /usr/local/lib, /usr/local/bin, etc.). Another application of the 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 processes 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 overlook what comes after this. For instance, “# This indicates a comment and here the shell will ignore.”

51. Tell me about command grouping and how it works

To group commands, you can use parentheses. For instance, if 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 commands 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 consoleIn 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 usedThe operator >> attaches the file output or makes 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 process.txt.

59. How to create a folder using Terminal?

You have to use the mkdir command, to make a new folderIt will look like: ~$ mkdir newfolder.

60. How to view the text file using Terminal?

To view 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 the 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?

The command that would help you to enable root logging:

#sudo sh-c ‘echo “greater-show-manual-login=true” >>/etc/lightdm/lightdm. conf’

Linux Technical and Networking Interview Questions

Linux Technical and Networking Interview Questions

63. What is a Stateless Linux Server?

Stateless Linux Server is a centralized server without any states existing 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 more secure than other OS?

As you know Linux is an open-source OS, and 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 follows.

  • 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 present in Linux OS such as Debian, Linux Mint, Arch, etc. All of the environments are protected from viruses.
  • The benefit of accounts: only a few users are allowed to have access to 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, 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 file details easily. 
  • Few Users: Because of the high-security measures of the Linux OS, its users are fewer compared 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 aren’t required 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 follows:

$ cat requirements.txt

67. Why should we use LINUX? 

There are some of the major reasons 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 viruses. This OS doesn’t let the attacker make any changes in the system until the root user logs in the system.
  • Compatibility of Hardware: you can use 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 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 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 follows:

  • 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 programs 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 and 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 Features

Some of the major features of a Stateless Linux Server are as follows:

  1. It stores every system’s prototype.
  2. It stores the home directories.
  3. It stores the snapshot that was taken. 
  4. It uses LDAP that holds information concerning which snapshot runs 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 processes. It is called the 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, Does the Ctrl+Alt+Del key combination work?

Yes, this key combination works 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 the 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 drives 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?

You need to check the overall usage of memory to realize whether the user can access the resources or whether the server is acceptable. Five methods can be used by Linux to determine the total memory usage.

Following are the methods that you can use to identify the overall usage of the memory.

  • /proc/meminfo: a common method to determine the 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 monitor the usage of RAM is the Top command.
  • Free command: it is one of the easiest 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 the ‘<’ 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 executes 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 follows:

/etc/sysconfig/kudzu

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 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

Conclusion

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Make Your Website Live Today

Choose one of your required Web Hosting Plan at market competitive prices

Temok IT Services
© Copyright TEMOK 2024. All Rights Reserved.