A genuinely free and open source operating system, Linux is one of the most liked operating systems. It was designed keeping in mind the Unix compatibility. Read our detailed Linux interview questions to know more about the features and commands of Linux. Usually, it is called as the clone of Unix. Linux was developed by Linus Torvalds. While working on the Unix OS, he felt the need to improve Unix, but the designers of Unix rejected his suggestions. Hence, he founded the Linux in 1991 as a kernel first, which was later launched as a full-fledged OS.
Here in this article, we will be listing frequently asked Linux Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.
An open-source operating system, Linux is currently one of the best OSs. It can be considered as software that sits underneath and communicates with the other software on a computer and passes on requests from those software programs to the hardware.
Linux is used because it is –
S.no | REDHAT | LINUX |
---|---|---|
1. | Specific distribution backed by the company RedHat | General term for the Linux OS. Can refer to any distribution. |
2. | RedHat is a specific OS built on Linux Kernel. | Linux is essentially a kernel. |
3. | To receive support and updates, one needs to have a proper agreement with the company. | Follows the Open source model |
If a Linux server runs out of memory, the kernel moves some inactive processes from Linux server to a disk that acts as the virtual memory. This disk space is called a Swap.
Read details about the security features of Linux in the next question of our Linux Interview questions list.
Linux has a layered structure –
Standard Utility library |
Applications |
The standard library of procedures |
|
Kernel |
Device drivers |
Hardware |
The core components of Linux are boot loader, kernel, shell, Daemons, window manager and X window server.
Virtual desktop provides secure access to Linux VDI even from non-Linux devices like Windows. This helps admins manage Windows and Linux applications using one console.
You can use the key combination Ctrl+Alt+T
to open a command prompt in Linux.
Use df [options] [devices] to check hard drive space.
Example –
df -h /test/tmp gives output as
Filesystem |
Inodes |
IUsed |
IFree |
IUse% |
Mounted On |
/test/tmp |
453K |
23 |
433 |
1% |
/ |
It is an environment variable that contains a list of paths that are used to resolve the library dependencies at run-time (dynamic libraries). This path is checked before the standard paths /lib or /usr/lib.
Idconfig is a command that creates the required links and cache to the most recently shared libraries that are present in the directories specified in the
Graphical User Interface or GUI makes it easier for a Linux user to execute programs via a desktop, similar to Windows. The desktops in Linux are KDE, Java, GNOME.
For enhanced security, a shadow copy of the password file is made, which stores hashed passwords of all the users. The hashed password is a long string of characters, generated based on the hashing method used.
Read further for more questions on security in our list of Linux interview questions.
S.no | CRON | ANACRON |
---|---|---|
1. | It is a daemon that runs scheduled tasks | It runs commands periodically, the frequency being defined in several days. |
2. | Example – updates, system backups | Example – a backup script that is scheduled to run weekly or monthly. |
3. | Suitable for machines that are on 24x7 like servers | Suitable for machines like laptops and desktops that are NOT on 24x7. |
4. | Runs as per defined schedules. | Checks if any job has to be executed when the user turns on the power. |
5. | Default system crontab file is /etc/crontab | Listed in /etc/anacrontab |
A program that gets executed in the background because of the occurrence of a specific event, process or condition. Daemon processes are managed by the Kernel. The operations are given unique PIDs.
1. | ext2 | Second extended filesystem. |
2. | ext3 | The concept of journaling was introduced, wherein, if a system crash or power failure occurred, the filesystems that were not saved could be recovered, unlike ext2. |
3. | ext4 | Performance improvements over the ext3 filesystem. Supports huge filesizes. |
Use chmod 777 to give full permission to reading, write and execute.
There are three modes – command mode, insert mode and last line or escape mode.
Use the command apt-get as –
apt-get --purge remove [filename]
There are 80 system calls in Unix that are used to control processes, manage filesystem and for inter-process communication. System calls occur in the kernel.
For this access the individual command’s manual page. For instance, to know the description of
cat command, type
man cat
This will display a description of the said command.
There are 7 types of network bond in Linux – mode=0 (balance-rr), mode-1 (active-backup),
mode=2 (balance-xor), mode=3 (broadcast), mode=4 (802.3ad), mode=5 (balance-tlb),
mode=6 (balance-alb)