Linux Interview Questions @Freecodecs
Linux Interview Questions @Freecodecs
© Copyright by Interviewbit
Contents
Linux OS internals
1. What are basic elements or components of Linux?
2. What is BASH?
3. What is Kernel? Explain its functions.
4. What are two types of Linux User Mode?
5. What is LILO?
6. What is swap space?
7. What do you mean by a Process States in Linux?
8. What is Linux Shell? What types of Shells are there in Linux?
9. Name different types of modes used in VI editor.
10. What is a maximum length for a filename under Linux?
11. Name the Linux that is specially designed by Sun micro system.
12. Under the Linux system, what is the typical size for swap partitions?
13. What are file permissions in Linux? Name different types of file systems in Linux.
14. Name the file that is used to automatically mount file systems.
15. What is LVM and why is it required?
16. What is a “/proc” file system?
17. What do you mean by the daemons?
18. Name daemon that controls the print spooling process.
19. What is a Zombie Process?
20. What is the difference between cron and anacron?
Linux Networking
26. Why /etc/resolv.conf and /etc/hosts files are used?
27. What are the advantages of using NIC teaming?
28. What do you mean by Network bonding?
29. What are different network bonding modes used in Linux?
30. Name default ports used for DNS, SMTP, FTP, SSH, DHCP and squid.
31. What is SSH? How we can connect to a remote server via SSH.
32. Write the difference between So and Hard links?
33. Name three standard streams in Linux.
Linux Commands
34. What is netstat command?
35. What is the ping command?
36. Which command is used to check the default run level?
37. Which command is used to check the size of file or directory?
Linux vs Other OS
48. Write difference between Linux and Unix.
49. What is the difference between BASH and DOS?
50. What is samba? Why is it required?
Conclusion
51. Conclusion
Linux OS internals
1. What are basic elements or components of Linux?
Linux generally consists of five basic elements or components as given below:
2. What is BASH?
Memory Management
Process Management
Device Management
Storage Management
Manage access, and use of various peripherals that are connected to the
computer.
5. What is LILO?
LILO (Linux Loader) is basically a bootloader for Linux that is used to load Linux into
memory and start the OS. It is also known as a boot manager that facilitates a dual
boot of a computer. It can function as either a master boot program or secondary
boot program and performs various functions such as locating kernel, identifying
other supporting programs, loading memory, and starting the kernel. If you want to
use Linux OS, then you need to install a special bootloader i.e., LILO for it as it allows
fast boot of Linux OS.
Different types of shells are commonly used on typical Linux system as listed below:
CSH (C Shell)
KSH (Korn Shell)
BASH (Bourne Again Shell)
TCSH
ZSH
Bourne Shell
12. Under the Linux system, what is the typical size for swap
partitions?
The typical size for a swap partition under a Linux system should be twice the
amount of physical memory or RAM available on the system.
Cron Anacron
Shell Script, as name suggests, is a script especially written for shell. Here, script
means programming language that is being used to control applications. It simply
allows the execution of different commands that are entered in the shell. It generally
helps you to create complex programs containing conditional statements, loops, and
functions. It is very easy to debug, can simplify everyday automation processes, and is
much quicker as compared to writing big programs.
24. Name the first process that is started by the kernel in Linux
and what is its process id?
The first process started by the kernel in Linux is “init” and its process id is 1.
Linux Networking
26. Why /etc/resolv.conf and /etc/hosts files are used?
/etc/resolv.conf: It is used to configure DNS name servers as it contains the details of
the nameserver i.e., details of your DNS server. The DNS server is then used to resolve
the hostname of the IP address.
Network Bonding, also known as NIC Teaming, is a type of bonding that is used to
connect multiple network interfaces into a single interface. It usually improves
performance and redundancy simply by increasing network throughput and
bandwidth.
30. Name default ports used for DNS, SMTP, FTP, SSH, DHCP
and squid.
Default ports used for various services are as follows:
Service Port
DNS 53
SMTP 25
SSH 22
squid 3128
Hard Links: It is a special kind of file that points to the same underlying inode as
another file. It can be referred to as an additional name for an existing file on Linux
OS. Total number of hard links for a file can be displayed using the “ls -l” command.
Such links cannot be used across file systems. Hard links can be created using the
following command:
$ ln [original filename] [link name]
So Links: It is also termed a symbolic Link. So links are kinds of files that usually
point to another file. It does not include any amount of data in the target file and
simply points to another entry anywhere in the file system. Such links can be used
across file systems. So links can be created using the following command:
$ ln -s [original filename] [link name]
It is considered a
It is considered a symbolic link to
mirror copy of the
the original file.
original file.
Linux Commands
34. What is netstat command?
netstat (Network statics) command is generally a networking tool being used for
troubleshooting and configuration and used to display all network connections on a
system. It simply provides a way to check whether various aspects of TCP/IP are
working and what connections are present.
Example:
$ du -sh /var/log/*
1.8M /var/log/anaconda
384K /var/log/audit
4.0K /var/log/boot.log
0 /var/log/chrony
4.0K /var/log/cron
4.0K /var/log/maillog
64K /var/log/messages
Grep (Global regular expression print) is a command that is used to the global search
for a string of characters in a specified file. The text search pattern is generally known
as a regular expression. It simply makes use of pattern-based searching.
The above command will usually print the total count of the word “Linux” in the file
“interview.txt”.
Example:
$env
PHYTHON_PIP_VERSION=9.0L1
HOME=/root
DB_NAME=test
PATH=/usr/local/bin:/usr/local/sbin
LAND=C.UTF=8
PYTHON_VERSION=3.4.6
PWD=/
DB_URI=mongodb://database:27017/test
“pwd” command is basically a command that is used to print the complete path of
the current working directory starting from the root (/). Here, “pwd” stands for Print
Working Directory. It is considered one of the most basic and most used commands
in Linux. This command is usually a built-in shell command and is also available in
different shells such as bash, ksh, zsh, bourne shell, etc.
42. Name the command that is used to check all the listening
ports and services of your machine.
# netstat -ntlp
pwd: It stands for “print working directory”. This command is generally used to
display the path of the present or current working directory.
Syntax: $ pwd
cd: It stands for “change directory”. This command is generally used to change
the present working directory to the directory that we want to work on.
Syntax: $ cd <path to new directory>
Is: It stands for “list”. This command is generally used to show the full list of
content of files and directories in the present working directory.
Syntax: $ ls
mkdir: It stands for “make directory”. This command generally allows users to
create directories in Linux.
Syntax: $ mkdir <name (and path if required) of new directory>
rmdir: It stands for “remove directory”. This command is used to remove/delete
each directory that is specified on the command line.
Syntax: $ rmdir <name (and path if required) of directory>
Linux vs Other OS
Unix: It is a closed source OS derived from the original AT&T Unix and was first
developed in the 1960s. It is not open source and is not free to use. It is generally
capable of handling activities from multiple users at the same time. Furthermore, it is
specially designed to be more portable, multi-user, and multitasking in a time-
sharing configuration. Different versions of Unix are known as distros.
Example: HP-UX, Solaris, etc.
Linux Unix
DOS (Disk Operating System): It is basically an OS that runs from a hard disk drive. It
was the first OS system used by IBM-compatible computers. It basically provides a
command-line in which users are allowed to give instructions in the form of
commands.
BASH DOS
Conclusion
51. Conclusion
Linux, like windows, iOS, and Mac, is an operating system that helps one to use or
utilize old and outdated computer systems such as Firewall, router, backup server,
etc. It makes computer systems more secure than Windows and does not require any
use of Anti-Virus Programs. It is becoming increasingly popular as the OS for servers
because it comes with the capabilities to heavily encrypt and protect all of a
computer's data. The above given are all important questions along with answers
related to Linux that were recently asked in Interviews. It will give you a better
understanding of all the important topics related to Linux and will help you to crack
the interviews.
Css Interview Questions Laravel Interview Questions Asp Net Interview Questions