{"id":92636,"date":"2022-08-22T06:41:55","date_gmt":"2022-08-22T06:41:55","guid":{"rendered":"https:\/\/www.fita.in\/?p=92636"},"modified":"2023-10-09T06:37:09","modified_gmt":"2023-10-09T06:37:09","slug":"linux-interview-questions-and-answers","status":"publish","type":"post","link":"https:\/\/www.fita.in\/linux-interview-questions-and-answers\/","title":{"rendered":"Linux Interview Questions and Answers"},"content":{"rendered":"

Linux is a widely used open source operating system that is suitable for personal and enterprise use. It is easy to learn and use, making it ideal for beginners or those who are looking for an easier alternative to other systems. Linux also offers a wide range of features, making it perfect for many different tasks from web servers to gaming servers.<\/span><\/p>\r\n

Linux has been used by millions of people around the world, including many in the IT industry. Linux is often used as the default operating system on personal computers and server systems. If you want to become an expert, then <\/span>Linux Training in Chennai<\/b><\/a> will help you get under the hood and know how everything works on Linux, what components work together, and how to use them from the experts at <\/span>FITA Academy<\/b><\/a>.<\/span><\/p>\r\n

In this article, we will discuss the most frequently asked Linux interview questions and answers. These are some of the most common questions that you may be asked in an interview or a technical test. You can use these as your reference to prepare for any interview.<\/span><\/p>\r\n

\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n

<\/i><\/i>Q1<\/span>. What is Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Linux is a popular operating system which is designed on the basis of the Linux kernel.<\/p>\r\n

This operating system is an Open Source Operating System and it runs on multiple Hardware Platforms.<\/p>\r\n

This operating system provides Free and Less Expensive Operating Services for Users.<\/p>\r\n

This Operating System is also considered as User Friendly Work Nature Which Can Be Modified Easily and Also Enables the User to Create Variations in the Source Code.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q2<\/span>. Why do we use Linux OS?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

We Use Linux OS because it Provides Us Free and Less Expensive Operation Services. We also Use Linux OS Because It Is A User Friendly Work Nature Which can be Modified Easily And Also Enables us To Create Variations In the Source Code.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q3<\/span>. How many types of Linux are there?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

There Are Three Types Of Linux : Red Hat Enterprise Linux, Ubuntu and Debian.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q4<\/span>. What is the difference between Linux and UNIX?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Linux and UNIX are two very similar operating systems. Both are considered as Operating Systems. They are designed to work on computers. But there are some major differences between Linux and UNIX. These differences make it possible for one OS to run applications written for another. Here we have listed the most significant differences between Linux and UNIX.<\/p>\r\n\r\n

Linux vs UNIX – Differences<\/b><\/p>\r\n

In Linux both paid and free distributions are available whereas in UNIX only paid distribution is available.<\/p>\r\n

Linux vs UNIX – Distribution<\/b><\/p>\r\n

Both Linux and UNIX<\/strong><\/a> come under the category of open source software. Linux is distributed freely while UNIX is sold commercially.<\/p>\r\n

Linux vs UNIX- Interface<\/b><\/p>\r\n

UNIX provides a graphical user interface while Linux does not provide such a facility.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q5<\/span>.  What is the Core of the Linux operating system?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

The Linux kernel is the core source code of the open source operating system. It provides basic functionality such as memory management, scheduling, interrupts and I\/O handling. Without it, Linux wouldn’t exist. The kernel is what makes Linux unique and powerful.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q6<\/span>.  Explain permission types in Linux.<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Each file or directory has three different permissions in Linux. These are called read, write, and execute. They determine how the owner of the file or the group of files can access it. There are four basic permissions and seven additional permissions.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q7<\/span>.  What is Linux Kernel?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

It is a computer’s operating system consisting of several layers. On the lowest level is the hardware layer, which is the most basic. This includes the processor, memory, hard disk drive, etc. Next comes the device driver layer. This contains drivers that allow devices like printers, scanners, modems, etc., to communicate with the rest of the computer. Then comes the application program layer. Using this layer, users are able to interact with the computer through the use of programs. Finally, at the topmost layer is the operating system itself. This layer takes care of allocating resources, managing processes, and providing a consistent environment across all programs.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q8<\/span>. What is the difference between Linux, BSD and Unix?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Unix was developed by AT&T Bell Labs. This operating system is based on Berkeley Software Distribution (BSD). Linux is derived from Unix but is owned by Linus Torvalds. BSD is an older version of Unix which is still used today.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q9<\/span>.  What is the difference between the Linux kernel and GNU?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

GNU stands for “GNU’s Not Unix”. It is a collection of tools that aim to bring more freedom to the development process. The Linux kernel is the heart of the Linux operating system. It is responsible for managing the hardware resources and running the other components of the operating system. GNU is a set of tools that helps programmers develop software.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q10<\/span>.  Is it legal to edit Linux Kernel?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Yes, it is absolutely legal to modify the Linux kernel. However, you should be careful when doing so because any changes made to the kernel may cause problems with your existing installation.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q11<\/span>. What is LILO?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

LILO is a boot loader. It loads the Linux kernel into RAM before starting up the operating system.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q12<\/span>. What is GRUB?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

GRUB is a boot loader. Like LILO, it also loads the Linux kernel into memory before starting up the operating system.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q13<\/span>. What is the advantage of open source?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Open source means that anyone can see the source code. This gives everyone the opportunity to improve upon the code. In addition, if there is a problem with the code, it will be easier to fix than proprietary software where only one company owns the code.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q14<\/span>. What are the basic components of Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

The main component of Linux is the kernel. It manages the hardware resources and runs the other parts of the operating system. Other important components include the shell, utilities, libraries, and applications.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q15<\/span>. Explain the differences between Linux and Windows?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Windows is a proprietary operating system developed by Microsoft. It uses a graphical user interface (GUI) and runs on personal computers.Unlike most other operating systems, Linux has no graphical user interface. CLI (command line interface) is used instead.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q16<\/span>. What is the advantage of Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Linux is an open source operating system based on Unix. It is one of the most popular OSes used today across different platforms such as desktops, servers, smartphones, tablets, etc. There are many advantages of using Linux over Windows and MacOS. Some of them include:<\/p>\r\n\r\n

Open Source Software<\/b><\/p>\r\n

The software development process in Linux is completely transparent. You don’t need to pay anything to use it. In fact, you can even modify the code yourself and contribute it to the project. This way, everyone benefits from the work done by others.<\/p>\r\n\r\n

Security<\/b><\/p>\r\n\r\n

Because Linux is built upon an open source model, there is no central authority controlling access to data. Anyone can access the files stored on the server without paying a fee. Moreover, the security measures implemented in Linux make it impossible for hackers to gain unauthorized access to sensitive information.<\/p>\r\n\r\n

Performance<\/b><\/p>\r\n\r\n

Unlike Microsoft Windows and Apple macOS, Linux doesn’t come preinstalled with unnecessary programs. Therefore, it uses less resources compared to the other two operating systems. Also, unlike Windows and macOS, Linux does not require a paid subscription to run.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q17<\/span>. Define shell?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Shell refers to the command prompt or terminal window through which users interact with the operating system. Shells usually have a text editor, file manager, and other useful features.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q18<\/span>. What are some of the most commonly used Linux shells?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Linux shell commandsare very useful because you can use them to automate tasks. There are many different types of shells that exist in Linux. Some examples include Bash, C Shell, Korn Shell, Bourne Again Shell, Z Shell, etc.<\/p>\r\n

In linux, bash, csh, and ksh are the most commonly used shells. These three shells are very popular among programmers. They are easy to learn and understand. For example, type man bash to know about the basic features of bash.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q19<\/span>. Name the Linux which is specially designed by the Sun Microsystems?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

The most popular operating system in the world is called Linux. But it wasn’t always that way. In fact, Linux began life as an open source project developed by Linus Torvalds. However, over the years, it became clear that his vision didn’t align with what people wanted out of a computer OS. So he left it behind to start something else entirely. And that something else is now known as Solaris.<\/p>\r\n

Solaris is the Linux of SUN Microsystems. It shares many similarities with Linux, including a similar command structure and a similar file format. But there are some key differences too. For example, Solaris includes a graphical shell called Zones while Linux doesn’t. Also, Solaris uses a different kernel architecture than Linux does. This makes Solaris faster and more secure than Linux. Plus, it has been around longer, so it’s got more features.<\/p>\r\n

But even though it’s older, Solaris isn’t dead. Instead, it lives on today as a separate product within Sun Microsystems. It’s still used by big companies like IBM, HP and Oracle, but it’s not as widely used as Linux.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q20<\/span>. Name the Linux loader?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

A loader is a program that loads another program into memory. The main purpose of a loader is to load the executable file into memory. A loader can be either dynamic (DLL) or static (EXE). Dynamic loaders are better suited for applications that need to be loaded at runtime. Static loaders are good for applications that don’t change often.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q21<\/span>. Write about an internal command?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Internal commands are commands that are built-in to the operating system. Examples of internal commands include ls, cd, cp, mv, rm, mkdir, chmod, chown, chgrp, chroot, mount, umount, df, du, lsof, ps, top, kill, shutdown, reboot, etc. Internal commands are also referred to as native commands.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q22<\/span>. Define inode?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Inodes are used to store information about files within a directory structure. Inode stands for Information Node. Every file in Linux is associated with one inode. A single inode contains data about the file including location, size, owner, permissions, etc. An inode is stored in the root directory along with other metadata like filename, creation date, access times, modification dates, etc.<\/p>\r\n

The inode stores information about each file. This includes basic attributes such as file type, owner, group, permission bits, pathname, device number, link count, etc.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q23<\/span>. Explain process id?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Every running process has a unique identifier called a Process ID (PID). Process IDs are usually represented using decimal numbers starting from 1. Each time a new process starts, its PID gets incremented by 1. When a process terminates, its PID gets decremented by 1.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q24<\/span>. What is Swap Space?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Swap space is a special area of RAM reserved for swapping processes out to disk when they run low on memory. Swapping is the process of moving pages of memory between RAM and hard drive. If you have 4 GB of RAM, but only 2 GB of free RAM, your computer will start swapping things out to the hard drive.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q25<\/span>. What is BASH?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Bash is short for Bourne Again SHell. Bash is a command line interpreter which allows users to execute programs written in C language. It is available in most UNIX systems.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q26<\/span>. What is the basic difference between BASH and DOS?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

DOS is a command line interface while BASH is a shell. Shell means a user interface for interacting with the operating system. It provides a way to enter commands and interact with the operating system. DOS is a command line interface where you just type commands and press Enter key. You cannot use any graphical tools to interact with the operating system in DOS.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q27<\/span>. What is the difference between Cron and Anacron?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Cron is a daemon process that runs every few seconds. It checks whether there are jobs to run, and executes those tasks. If you want to schedule a task to run once per day, you can use cron. You can set up a task to run every hour, or every five hours, or even every ten minutes. If you don’t specify a time, cron will check every 15 minutes. For example, to run a script every 30 minutes, you could do something like this: * *\/30 * * * \/path\/to\/script.sh. This command tells cron to execute the shell script every 30 minutes.<\/p>\r\n

Anacron is a daemon process similar to cron, except that it does not require the computer to be running. Instead, it waits for the computer to turn on, and then starts executing the commands specified in the configuration file. This makes it possible to configure scripts to run automatically without requiring the computer to be powered on. Anacron is useful for tasks such as starting up network interfaces, connecting to printers, and performing backups. To start the daemon, type sudo anacron -f.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q28<\/span>. Explain various file permissions in Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

In Unix\/Linux operating systems, every file and directory has three different types of owners called Users, Groups, and Other. Each owner can grant certain privileges to others. These privileges include reading, writing, executing, modifying, deleting, etc., to the file or directory. There are three kinds of permissions associated with the file or directory owner:<\/p>\r\n

Read<\/b> – Allows the owner to view the information contained within a file.<\/p>\r\n

Write<\/b> – Allows the owner to modify the data stored inside a file.<\/p>\r\n

Execute<\/b> – Permits the owner to run the program.<\/p>\r\n

The above three permissions are applied to each owner individually. If one type of permission is denied, none of the other permissions apply.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q29<\/span>. Does Ctrl+Alt+Del key combination work on Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

Yes, it works fine on Linux. The Ctrl+Alt+Delete key combination is used to bring up the log-in screen. When you press Ctrl+Alt+Del, the login screen appears. To return to the log-in screen after rebooting the machine, press Ctrl+Alt+Delete again after you are logged in to the desktop environment.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q30<\/span>. How many process states are there in Linux?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

There are four main process states in Linux: Running, Stopped, Blocked, and Zombied. A running process is active and ready to accept new requests from the kernel. A stopped process is inactive but still exists. An execution is blocked until some event takes place before the process can be restarted. A zombie process is dead.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q31<\/span>. In the New process state, what happens?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n

A process enters the new process state when its parent process terminates. In this case, the child process inherits all the attributes of the parent process. The child process becomes a zombie until it receives a SIGCHLD signal.<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n

\r\n
\r\n

<\/i><\/i>Q32<\/span>. What happens in the Terminated process state? Explain with a brief example?<\/a><\/h4>\r\n<\/div>\r\n
\r\n
\r\n