Linux
Linux
Refer your friends and earn 10% the first time they enroll! Invite Now
Blog
Linus Torvalds created Linux. Linus Torvalds was a student at the University of Helsinki, Finland in
1991. He started writing code on his own to get the academic version of Unix for free. Later on, it
became popular as Linux Kernel.
Linux kernel is the heart of the operating system. It acts as a bridge between Software and
Hardware. If the Software requests the Hardware, then the kernel delivers the data between the
Software and Hardware.
Contact us
For example, if you want to play a song you should launch your default player, it requests the kernel
Privacy - Terms
to play a song, now the kernel will contact the hardware to seek the permissions or to seekTrusted
the Site
https://datavalley.ai/top-linux-interview-questions/ 1/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Yes, the kernel can edit, because it is released under General Public License.
4. What is Shell?
Home
Shell Aboutprogram,
is a computer us Courses an Student
that acts as Portal theCareers
interface between user and Events
the kernel. Users
Hire
can
communicate with the kernel by writing programs, commands, and scripts on the shell. It accepts
human-readable commands and converts them into kernel-understandable language.
C Shell (csh): It is like C syntax and provides spelling checking and job control.
Z Shell (Zsh): It provides some unique nature like it observes login/logout watching, file name
generating, startup files, and closing comments.
1. Kernel: It is the core component of Linux, it acts as an interface between Software and
Hardware.
3. GUI: It stands for Graphic User Interface, which is another way for the user to interact with the
system. But it is unlike images, buttons, and text boxes for interaction.
4. System Utilities: These are the software functions that allow users to manage the computer.
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 2/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
software and acts as a replacement for Bourne Shell. It is an interpreted and not compiled process
which can also be run in the terminal window.
This allows users to write commands and cause actions. Bash is capable of reading commands from
Home
shell scripts. About us
Courses Student Portal Careers Events Hire
Linux Unix
Linux is free. And it is downloaded through the internet Most Unix Like Operating Systems is
under GNU licenses. not free.
Linux is used on home-based PCs, phones, etc. Unix is used in server systems.
Linux is a Unix Clone. But if you consider Portable Operating System Interface (POSIX) standards
then Linux can be considered as UNIX.
All Linux distributions include GUI system, GNU utilities, installation & management tools, GNU
Contact us
c/c++ Compilers, Editors (vi), and various applications like OpenOffice, and Firefox.
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 3/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Linux comes with an Open-Source Netfilter and IPTables-based firewall tool to protect your server
and desktop from crackers and hackers. UNIX Operating Systems come with their own firewall
Home
products. About us Courses Student Portal Careers Events Hire
UNIX and Linux come with their own set of tools for backing up data to tape and other backup
media. However, both Linux and UNIX share some common tools such as tar, dump/restore, cpio,
etc.
9. What is LILO?
LILO means Linux Loader is a boot loader that is used for the Linux operating system. Most of the
Linux Operating systems use LILO, to boot the operating system into the main memory to start the
operations.
CLI means Command Line Interface. It interacts with the computer program, where the user issues
commands in the form of text lines. It Interacts with the computer terminals also, the interface
accepts the text lines and converts them as a command to the operating system.
Linux was one of the first Open-Source Technologies, many programmers added Software that is
completely open to the users, which means you can download the file and change the code as you
like. It has a wide range of options for users and increased security.
1. The difficulty of use – Some open-source applications may be tricky to set up and use. Others
Contact us
may lack user-friendly interfaces or features that your staff may be familiar with. This can affect
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 4/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
productivity and prevent your staff from adopting or using programs with ease.
[email protected]
3. Liabilities and warranties – With proprietary software, the developer usually provides
Home About us Courses Student Portal Careers Events Hire
indemnification and warranty as part of a standard license agreement. This is because they fully
control and copyright the product and its underlying code. Open-source software licenses
typically contain only limited warranty and no liability or infringement indemnity protection
4. Hidden costs – Software that is free up-front but later costs money to run can be a major
burden, especially if you haven’t considered hidden costs from the outset.
Launch your terminal by pressing CTRL+ALT+T or by giving the terminal in the menu search bar.
Swap Space is used when the physical Ram memory is running out. It will move the Ram inactive
pages to the swap space. It can consider in the form of a dedicated swap partition or swap files.
GUI means Graphical User Interface. It is a human-computer interface that uses windows, images,
icons, and menus which can be manipulated by using a mouse. Most of the modern applications in
electronic gadgets communicate with the user through GUI. GUI is a combination of graphical and
textual interaction that uses buttons, menus, message boxes, etc.
They are
2. Write: It refers that they can write the file or modify the file of a directory.
3. Execute: It affects the user’s capability to execute the file or to view the file of a directory.
Contact us
17. What are the environmental variables? Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 5/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
They are dynamic values that affect the process of programs on a computer. They exist in every
[email protected]
operating system and their types may vary. They can be created, edited, saved, and deleted and
Refer your friends and earn 10% the first time they enroll! Invite Now
they also give information about the system’s behavior.
It will be redirected to another file using its path. Target files do not contain any data. Symbolic links
Hometo another
redirect Aboutentry
us somewhere
Coursesin the file
Student Portal
system. If the targetCareers
file is deleted,Events
Hire
the link to that file
A Hard link is another name for an existing file on Linux. We can create so many numbers of Hard
links, for any file. They can create links for other hard links.
Redirection can be defined as changing the standard input and output devices. To redirect
metacharacters are used, you can redirect the file or program.
A Daemon is a background process that accepts requests for service from other computers, most
operating systems use daemons in other forms.
The root is the user name, which default has access to all files and commands. The root user can do
many things, but an ordinary user cannot do like installing software, changing file permissions, etc.
A virtual Desktop is a user interface when you are facing the problem of how to manage multiple
windows on your desktop, virtual desktop serves as an alternative. Virtual desktop stores remote
server and allow you to use one or more programs on a clean slate.
24. What are the different modes when using the vi editor?
Contact us
There are three kinds of modes in vi editors. They are
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 6/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Insertion Mode/Edit
ReferMode.
your friends and earn 10% the first time they enroll! Invite Now
There are three user-based permission groups for each file and directory.
Home About us
Courses Student Portal
Careers
Events
Hire
They are:
1. Owner: Owners only will have to access the file or directory, they will not impact the actions of
other users.
2. Group: These permissions apply only to the group, that has been assigned to the file or
directory. They will not impact the actions of other users.
3. All Users: These permissions are applied to all users on the system.
Linux file system stores and handles the data. Without a file system, it cannot know where the file
starts and where the file ends.
Ext, Ext2, Ext3, Ext4, JFS, XFS, btrfs, ufs, autofs, devpts, ntfs and swap.
The inode is a unique name given to each file and the process id is a unique name given to each
process.
LVM stands for Large Volume Management, it is a storage management device. Users can create,
resize, and delete LVM partitions. It increases abstraction, flexibility, and control. LVM is used to
gather existing storage devices into the group and allocate logical units.
unmask stands for user file creation mode. When the user creates any file, it has default file
permissions. So unmask will specify a few restrictions to the newly created file (it controls the file
permissions).
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 8/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Options [email protected]
Refer your friends and earn 10% the first time they enroll! Invite Now
-S Accept a symbolic representation of a mask, or return one.
If a valid mask is specified, the umask is set to this value. If no mask is specified, the current
mask
umask value is returned.
Home
WhatAbout us Courses
modesStudent Portal Careers Events Hire
32. are the different of Network bonding in Linux?
Mode-0(balance-rr): It is a default mode and is based on the Round-Robin policy. It offers fault
tolerance and load-balancing features. It used a round-robin fashion to transmit the packets.
Mode-1(active-backup): It is based on the Active Backup policy and only one slave will act in the
band and another one will act when the others fail in the band. It also provides fault tolerance.
Mode-2(balance-xor): It sets a xor mode between the source Mac address and destination Mac
address to provide fault tolerance.
Mode-5(balance-tlb): The outgoing traffic is according to the current load on the slave, and the
incoming traffic is received by the slave. It is called an adaptive transmit load balancing mode.
Mode-6(balance-alb): It is an adaptive load balancing mode. It does not require any switch
support.
To display the default route and routing table, we use the following commands.
$ route-n
$ nestat-rn
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 9/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
[email protected]
$ IP
Refer your friends and earn 10% the first time they enroll! Invite Now
If the unmask command is invoked without any arguments, it means it will display the current mask.
Home About us
Courses
Student Portal
Careers
Events
Hire
To set the unmask permanently, we have two types.
They are:
Ocotal representation.
Symbolic representation.
Network Bonding is a process of combining more than two network interfaces to form a single
network interface. It offers performance improvement and redundancy by increasing network
throughput and bandwidth.
No need to worry if one interface is down or unplugged because the other will work. The behavior of
the bonded interface depends on the bonding method.
We have two commands to check which ports are in listening in Linux Server. Following are the two
commands
# netstat --listen
# netstat -l
To share a directory using NFS, first edit the configuration file and ‘/etc/exports’ and add an entry
like directory name ‘/<directory-name>’. Now restart the NFS service.
Refer your friends and earn 10% the first time they enroll! Invite Now
Service Port
SMTP 25
DNS 53
Home About us
Courses
Student Portal
Careers
Events
Hire
FTP 20(Data Transfer) 21(Connections Established)
SSH 22
Squid 3128
Locking user accounts is done for security purposes so that unauthorized users cannot log in. So, we
have a few ways to lock the user account. Some of them are below.
2. Expire the user account using the usermod command or chage command.
It is one of the basic commands in Linux. It is used to list all the files and directories in the file system.
Syntax:
ls [OPTIONS] [FILES]
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 11/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
We can use it without passing the arguments, then it will list all the files in the current working
[email protected]
directory. Files will be displayed in alphabetical order.
Refer your friends and earn 10% the first time they enroll! Invite Now
Is
Home About us
Courses
Student Portal
Careers
To list the specific directory files use the directory name in the syntax, follow as shown in the below
Events
Hire
syntax.
ls /etc
We can also pass multiple directories names in the syntax, but separated by space.
lib/modules/kernel-version/, this directory stores all the information about the compiled drives
under the Linux system. Using the lsmod command also we can see the installed kernel modules.
To change the default run level in Linux use the init command.
The Tail command print the last N number of lines of the given data, it prints 10 lines by default.
Syntax:
Example:
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 12/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
[email protected]
$ cat names.txt
Tableau Refer your friends and earn 10% the first time they enroll! Invite Now
sql server
Home About us
Courses
Student Portal
Careers
Events
Hire
linux administration
env is a shell command used to print a list of current environmental variables and it can run another
process in another environment without any modification of the current environment.
Options
Tag Description
-0, –null output line End with a 0 (null) byte rather than a new line.
The top command is used to show the system process and it displays and updates the sorted
process information.
Contact us
46. What is the netstat command in Linux?
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 13/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
lsof means a List of files, we can know which file is opened by which process.
Home About us
Courses
Student Portal
Careers
Events
Hire
#lsof
-
This command is used to change the permission of files and directories. It’s an important command
so, I’ll explain it briefly. Therefore, on the whole, there are three types of permission, read, write and
execute which are represented by numbers as shown below.
1. 4 – read permission
2. 2 – write permission
3. 1- execute permission
syntax:
Contact
grep command us that is used for the global search for regular expressions.
is a filter
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 14/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Syntax: [email protected]
Refer your friends and earn 10% the first time they enroll! Invite Now
Syntax:
Ps [options]
Output:
[root@rhe17~]# ps
Contact
Chown command: uscommand “chown” stands for change file owner and Group. This command
The
is used to change the ownership of one or more files or folders for a specified user or group.
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 15/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
syntax: [email protected]
Refer your friends and earn 10% the first time they enroll! Invite Now
$ chownAbout
Home [OPTION]…
us –reference=RFILE
Courses FILE…
Student Portal
Careers
Events
Hire
rm command: The rm command is used to remove the directory or file specified on the command
line. You need to be careful while removing any file or directory.
Syntax:
rm filename—
Command Description
cp command: cp command is used to copy files and directories. It is also used to back up files or
directories.
Syntax: Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 16/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
$ cp filename [email protected]
Refer your friends and earn 10% the first time they enroll!
54. What is mkdir in Linux? Invite Now
mkdir, the command allows users to create directories in Linux. Users can create multiple directories
at once and can set the permissions to the directories.
Home
Syntax: About us
Courses
Student Portal
Careers
Events
Hire
Option Description
-m=mode, –mode=mode To set a file mode (Permissions, etc.) for the created Directories
–v, –verbose Verbose Output. Print a message for the created Directory.
–Z= context, – If you are using SELinux, this option sets the security context of each
context=context created Directory to context.
We can use two commands to exit from the vi editor. They are
Wq: wq command saves the current work and exits from the vi editor.
q!: q! The command does not save the current work, but it exits from the vi editor.
The rmdir is used to remove each directory specified on the command line.
Contact us
Syntax:
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 17/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
[email protected]
rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories
Refer your friends and earn 10% the first time they enroll! Invite Now
The following commands are used to delete information from a file in vi editors.
We are many reasons, but a few important reasons are listed. Following are
High Stability: It is very stable and does not lead to crashes, it runs fastly as it is when it was
installed first.
Security: It is a dependable server, that offers high security to the user. Using Linux on your
system it is easy to avoid viruses and malware. The attacker cannot change any changes in the
system until the user logged in as the root user.
Easy to Operate: Linux is easy to operate and we can install it easily onto the system because all
the variants of Linux have their own software repositories. You can update the system periodically
with just aContact usor you can set automatic updation.
few clicks
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 18/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Open Source: Source code is available for free, and it’s a community-based development
project.
Multi-User: Multiple users can use ram, and applications, and run programs at the same time.
Shell: It has a special interpreter program where you can execute programs and commands of
the system.
Bash Dos
The backward slash ( / ) represents the directories Backward Slash ( / ) represents command
separator. arguments.
Forward slash ( \ ) represents the escape Forward slash ( \ ) represents the directories
character. separator.
Does not follow conventions naming in files. Follow the naming convention in files.
63. Enlist some Linux distributors (Distros) along with their usage.
We have so many Linux Distributors, among them, we discuss a few important ones.
Ubuntu: It is available for both desktop and server editions and is based on Debian.
It is a form of redirection that is used in Linux, it is used to combine more than two commands and
the output of one command can take as input to the next command.
Syntax:
Contact
4. Uses LDAP, whichuscontains the information about which snapshot should run on which system.
66. What is Zombie Process? Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 20/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
It is a process whose execution is completed but even the information exists in the process table. It
[email protected]
occurs for the child process because the parent process needs to read the child process status.
Refer your friends and earn 10% the first time they enroll! Invite Now
Once it is completed using the wait system call, then the zombie process is removed from the
process table. This is known as Zombie Process.
67. Explain the work of the Ctrl+Alt+Del key combination on the Linux
operating system.
Home About us
Courses
Student Portal
Careers Events Hire
In Linux, the Ctrl+Alt+Del key is used to restart the computer, and it does not display any
confirmation message before rebooting the system.
68. Describe how a parent and child process communicates with each
other.
The parent process communicates with the child process by using pipes, sockets, messages queues,
and more.
It is a centralized server that does not have any existing states on the working station. It may have
scenarios when a state of a particular system takes a snapshot then, the user wants all other
machines to be in that particular state.
70. Why is Linux considered more secure than other operating systems?
The perk of accounts: Linux allows only a few users to access the system. Thus, the virus cannot
attack the whole system, it may cause only a few files in the system.
Strong Community: Linux users first accomplished the files before they open. So they can save
their systems from vulnerabilities.
Iptables: Iptables are used by Linux because it checks the security circle of the system.
Different Working Environment: Linux system has different working environments like Linux
Mint, Debian, Arch, and many more, these working environments protect from viruses.
Recording in Linux: It maintains log history because later it can view the details of the system
files easily.
Contact us
Few Users: Linux users are fewer compared to others, and due to this security will be more.
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 21/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
your dependencies file or to confirm the version of the application that you have already built
locally.
cat Example:
Home About us Courses Student Portal Careers Events Hire
$ cat requirements.txt
flask flask_pymongo
The tail command displays the last part of a file. Generally, users don’t need every logline to
troubleshoot. Instead, you want to check what your logs say about the most recent request to your
application.
tail Example:
grep searches file patterns. If you are looking for a specific pattern in the output of another
command, grep highlights the relevant lines. Use this grep command for searching log files, specific
processes, and more.
grep Example:
Refer your friends and earn 10% the first time they enroll!
75. What is ps command in Linux? Invite Now
the ps command displays the process status. Use this ps command to determine a running
application or confirm an expected process.
Home
ps About
Command us
Example: Courses Student Portal Careers Events Hire
top command displays and updates sorted process information. Use this top command to determine
which processes are running and how much memory and CPU they are consuming.
Users can use the df command to troubleshoot disk space issues. Here df stands for display-free disk
space.
df Command Example:
df -h
Linux Windows
Refer your friends and earn 10% the first time they enroll! Invite Now
File names are case particular Irrespective of the case while naming files
iptables command blocks or allows traffic on a Linux host, similar to a network firewall. This iptables
Home About us Courses Student Portal Careers Events Hire
command may prevent certain applications from receiving or transmitting requests.
netstat command in Linux shows the network status. This netstat command shows network ports in
use and their incoming connections.
du command in Linux is used to retrieve more detailed information about which files use the disk
space in a directory.
du Command 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
83. How do you kill the program using one port in Linux?
Use this command to kill the program using one port: sudo fuser -k 8000/tcp
Contact us
84. How do you limit memory usage for commands?
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 24/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
[email protected]
· ulimit -Sv 1000 # 1000 KBs = 1 MB
· Refer
ulimit -Svyour friends and#earn
unlimited 10% the
Remove first time they enroll! Invite Now
limit
Home
cd About us
dir && command goes Courses
to the Student
dir, executes
Portal and
the command, Careers
returns to the
Events
current Hire
directory.
push the command and put the current dir on the stack so you can pop back to it.
90. How do you list the contents of tar.gz and extract only one file?
· tar tf file.tgz
· tar xf file.tgz filename
fdisk -I command show disks partitions sizes and types (run as root).
[email protected]
It is useful to detect permissions errors, for example when configuring a web server.
namei -l About
Home /path/to/file.txt
us Courses
Student Portal
Careers
Events
Hire
94. What does this du -hs /home/* | sort -k1,1h command do?
96. How do you run the command every time a file is modified?
starting. [email protected]
Refer your friends and earn 10% the first time they enroll! Invite Now
env Command Example:
$ env
PYTHON_PIP_VERSION=9.0.1
Home About us
HOME=/root
Courses
Student Portal
Careers
Events
Hire
DB_NAME=test
PATH=/usr/local/bin:/usr/local/sbin
LANG=C.UTF-8
PYTHON_VERSION=3.4.6
PWD=/
DB_URI=mongodb://database:27017/test
100. How do you combine two lines from two sorted files in Linux?
ls – ISr command shows files by size, the biggest file will be displayed last.
Search
103. How do you run a command for a limited time?
AWS (173)
Contact us
AWS Certification Interview Questions (83)
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 27/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Azure DevOps Refer your friends and earn 10% the first time they enroll! Invite Now (5)
BigData (8)
DevOps (77)
GCP (2)
IT Infrastructure (1)
Python (69)
SQL (23)
Uncategorized (1)
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 28/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Refer your friends and earn 10% the first time they enroll! Invite Now
Become An Instructor
Top instructors from around the world teach millions of students on Datavalley.
Become A Trainer
Home About us Courses Student Portal Careers Events Hire
Subscribe to Newsletter
Stay ahead of the rapidly evolving world of technology with our news letters. Subscribe
now!
Email Subscribe
UK
Contact us About US
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 29/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
Contact Us
[email protected]
Courses
Refer your friends and earn 10% the first time they enroll! Invite Now
Our Team
Links
Home About us Courses Student Portal Careers Events Hire
Blogs
FAQ's
Join Discord
News
Work With Us
Job Openings
Become an Instructor
Courses
Data Engineering
DevOps Engineering
Power Bi
Data Science
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 30/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023
[email protected]
© 2023 Datavalley Inc. All Rights Reserved.
Refer your friends and earn 10% the first time they enroll! Invite Now
Contact us
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 31/31