0% found this document useful (0 votes)
2 views31 pages

Linux

The document provides a comprehensive list of over 100 Linux interview questions and answers, covering topics such as the Linux operating system, its kernel, shell types, and differences between Linux and Unix. It also discusses file permissions, process management, and the advantages and disadvantages of open-source software. This resource serves as a guide for individuals preparing for Linux-related job interviews.

Uploaded by

Manikanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views31 pages

Linux

The document provides a comprehensive list of over 100 Linux interview questions and answers, covering topics such as the Linux operating system, its kernel, shell types, and differences between Linux and Unix. It also discusses file permissions, process management, and the advantages and disadvantages of open-source software. This resource serves as a guide for individuals preparing for Linux-related job interviews.

Uploaded by

Manikanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

[email protected]

Refer your friends and earn 10% the first time they enroll! Invite Now

Home About us  Courses  Student Portal  Careers  Events  Hire


Home / Operating System / Top 100+ Linux Interview Question and Answers

Blog

Top 100+ Linux Interview Question and Answers


 Datavalley  December 1, 2022  3:36 pm  No Comments

Linux Interview Questions – 1.What is Linux?

Linux is an operating system, which is based on Linux Kernel. It is an Open-Source Operating


System, where it can run on different Hardware platforms. It provides a free and low-cost operating
system for users. It is a user-friendly environment where they can easily modify and create variations
in the source code.

2. Who invented Linux? Explain the history of Linux.

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.

3. What is 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

hardware components like if you plugged[email protected]


any headset to the device. Most Android phones use
Linux kernels.
Refer your friends and earn 10% the first time they enroll! Invite Now

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.

5. How many types of Shells are there in Linux?

They are five Shells in Linux:

C Shell (csh): It is like C syntax and provides spelling checking and job control.

Korn Shell (KSH): This is a high-level programming language shell.

Z Shell (Zsh): It provides some unique nature like it observes login/logout watching, file name
generating, startup files, and closing comments.

Bourne Again Shell (Bash): It is the default to Linux distributions.

Friendly Interactive Shell (Fish): It provides web-based configuration, auto-suggestions, etc.

6. What are the basic components of Linux?

Basic components of Linux

1. Kernel: It is the core component of Linux, it acts as an interface between Software and
Hardware.

2. Shell: It acts as an interface between the user and the Kernel.

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.

5. Application Programs: A set of functions designed to perform a set of tasks.

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

7. What is BASH?  [email protected]

Bash is a Unix shell and


Refercommand
your friendsprocessor written
and earn 10% bytime
the first Brian Fox
they for the
enroll! GNU
Invite project. It is free
Now

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

8. What is the difference between Linux and Unix?

Here is the difference between Linux and Unix – mentioned below

Linux Unix

Different paid structures for different


Both paid and free distributions are available.
levels of Unix.

Linux primarily uses GUI with an optional command-line


Unix uses the command-line interface
interface

Linux OS is portable and can be executed on different


Unix OS is not portable.
hard drives

Unix is developed by AT&T


Linux is developed by a worldwide Linux community.
developers.

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.

And some other differences.

Linux is a Unix Clone. But if you consider Portable Operating System Interface (POSIX) standards
then Linux can be considered as UNIX.

Linux Is Just Kernal

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

UNIX operating systems are considered as


[email protected]
complete OS as everything comes from a single
vendor.
Refer your friends and earn 10% the first time they enroll! Invite Now

Security And Firewall

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

Backup and Recovery

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.

10. What is CLI?

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.

YouTube Display Ad 3 page 0001 12

11. What is the advantage of Open Source?

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.

12. What is the disadvantage of Open Source?

The disadvantages of Open Source Operating Systems are mentioned below

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]

2. Compatibility Issues – Many


Refer your types
friends of proprietary
and earn 10% the first hardware need Invite
time they enroll! specialized
Now drivers to run
open-source programs, which are often only available from the equipment manufacturer. This
can potentially add to the cost of your project. Even if an open-source driver exists, it may not
work with your software as well as the proprietary driver.

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.

13. How do you open a command prompt when issuing a command?

Launch your terminal by pressing CTRL+ALT+T or by giving the terminal in the menu search bar.

14. What is a swap space?

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.

15. What is the GUI?

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.

16. Explain File Permissions types in Linux.

Linux file permissions – Each file or directory has 3 permissions

They are

1. Read: It refers to only they can read the file.

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.

18. What are the symbolic links?

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

is removed, but not the file.

19. What are the Hard links?

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.

20. What is redirection?

Redirection can be defined as changing the standard input and output devices. To redirect
metacharacters are used, you can redirect the file or program.

YouTube Banner Ad 2 page 0001 10

21. What are Daemons?

A Daemon is a background process that accepts requests for service from other computers, most
operating systems use daemons in other forms.

22. Describe the root account.

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.

23. Explain the virtual desktop.

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

Command Mode/ Regular Mode  [email protected]

Insertion Mode/Edit
ReferMode.
your friends and earn 10% the first time they enroll! Invite Now

Ex Mode/ Replacement Mode.

25. Explain File Permission groups in Linux.

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.

26. What is a File system in Linux?

Linux file system stores and handles the data. Without a file system, it cannot know where the file
starts and where the file ends.

27. Explain different file system types in Linux.

In Linux, there are many file systems:

Ext, Ext2, Ext3, Ext4, JFS, XFS, btrfs, ufs, autofs, devpts, ntfs and swap.

28. What are inode and process IDs?

The inode is a unique name given to each file and the process id is a unique name given to each
process.

29. What are the Process states in Linux?

Five process states in Linux. They are

1. New/ Ready: A new process is created and ready to run.

2. Running: The process is being executed.


Contact us 
3. Blocked / Wait: The process is waiting for input from the user.
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 7/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

4. Terminated / Completed: The process completed the execution or terminated by the


[email protected]
Operating System.
Refer your friends and earn 10% the first time they enroll! Invite Now
5. Zombie: The process is deleted, but still the information regarding the process exists in the
process table.

30. Explain Process Management System Calls in Linux.


Home About us 
Courses
The process management system calls in Linux:

Student Portal 
Careers 
Events 
Hire

fork(): Used to create a new process.

exec(): Execute new process.

wait(): wait until process execution.

exit(): exit from the process.

System calls to get the Process id :

getpid(): to find the unique process id.

getppid(): to find the unique parent process id.

Linux Admin Interview Questions


YouTube Display Ad 3 page 0001 13

31. Why LVM is required?

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.

32. What is umask?

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

umask [-S] [mask]

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?

Different modes of Linux network bonding

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-3(broadcast): It is based on broadcast policy and transmitted everything in the slave


interface. It also provides fault tolerance and can be used only for a particular purpose.

Mode-4(802.3ad): It is a dynamic aggregation mode, it created aggregation groups which is


having the same speed. It uses the transmit hashing method to select the slaves for outgoing
traffic.

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.

33. How to check the default route and routing table?

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

34. How to set the mask permanently for a user?

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.

35. What is network bonding in Linux?

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.

36. How to check which ports are listening in my Linux Server?

We have two commands to check which ports are in listening in Linux Server. Following are the two
commands

# netstat --listen
# netstat -l

37. How to share a directory using NFS?

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.

38. What Contact 


are theusdefault ports used for SMTP, DNS, FTP, DHCP, SSH, and
squid?
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 10/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

Details mentioned below  [email protected]

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)

DHCP 68(DHCP client), 67(DHCP server)

SSH 22

Squid 3128

39. How to lock a user account in Linux?

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.

1. Lock or disable the password using the passwd command.

2. Expire the user account using the usermod command or chage command.

3. Changing the shell using nologin command ( /sbin/nologin ).

Linux Commands Interview Questions


Youtube Banner Ads 3 1 page 0001 12

40. What is the ‘ls’ command and what it does do?

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.

ls /etc /var /etc/passwd

41. Where the kernel modules are located?

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.

42. How to change the default run level in Linux?

To change the default run level in Linux use the init command.

43. What is the tail command in Linux?

The Tail command print the last N number of lines of the given data, it prints 10 lines by default.

Syntax:

tail [OPTION]... [FILE]

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

Now, check the syntax without giving any option or input.


$ tail state.t

44. What is the env command in Linux?

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.

env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]

Options

Tag Description

–i, –ignore environment Start with an empty environment.

-0, –null output line End with a 0 (null) byte rather than a new line.

-u, –unset=NAME removes variable NAME from the environment

–help Display a help message and exit.

45. What is the top Command in Linux?

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

netstat command gives various information


 about the network and routing tables, interface statics,
[email protected]
and more about the system.
Refer your friends and earn 10% the first time they enroll! Invite Now

47. What is lsof command in Linux?

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
-

48. Explain about chmod command.

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:

$ chmod options permissions file name

$ chmod [OPTION]... MODE[,MODE]... FILE...

$ chmod [OPTION]... OCTAL-MODE FILE...

$ chmod [OPTION]... --reference=RFILE FIL

49. What is the grep command in Linux?

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

grep [options] pattern [files]

50. What is ps command in Linux?


Home About us 
Courses 
Student Portal 
Careers 
Events 
Hire
The ps command displays the current process status of the system. And it displays the process IDs
with some other related data also.

Syntax:

Ps [options]

Output:

[root@rhe17~]# ps

PID TTY TIME CMD

12330 pts/0 00:00:00 bash

21621 pts/0 00:00

YouTube Banner Ad 2 page 0001 11

51. Explain about chown command.

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

$ chown [OPTION]… [OWNER][:[GROUP]] FILE…


Or

$ chownAbout
Home [OPTION]…
us  –reference=RFILE
Courses  FILE…
Student Portal 
Careers 
Events 
Hire

52. How to remove a file or directory from the system in Linux?

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

rm filename Removes single file.

rm filename1, filename2, filename


Removes multiple files.
3

rm * .pdf Removes all pdf files in the current directory.

rm -i filename(s) -i mean to confirm before deleting the file

rm -f filename(s) Removes files without prompting

Remove all .txt files in the current directory without


rm -fv *.txt
prompting

53. What is the cp command in Linux?

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

mkdir [options...] [directories ...]

Option Description

Directory Name of the Directory to be created

-m=mode, –mode=mode To set a file mode (Permissions, etc.) for the created Directories

-p, –parents Create Parent 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.

–help Shows help message and exit

–version It shows version information and exit

55. How to exit from vi editors?

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.

56. Explain rmdir command in Linux.

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

57. Enlist some Linux to file content commands.

File content commands


Home About us 
Courses 
Student Portal 
Careers 
Events 
Hire
1. head: Display the top lines of the file.

2. tail: Display the last lines of the file.

3. cat: Concatenate more than 2 files.

4. more: Displays the content in pager form to view in the terminal.

58. How to delete information from a file in vi?

The following commands are used to delete information from a file in vi editors.

1. Command x deletes the current character.

2. Command dd deletes the current line

Linux Technical Interview Questions and Answers for


Experienced
Youtube Banner Ads 3 1 page 0001 13

59. Why do we use LINUX?

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

Hardware Compatibility: Linux can use


 on any hardware, it doesn’t have any hardware
[email protected]
restrictions. It uses efficiently all system resources.
Refer your friends and earn 10% the first time they enroll! Invite Now
Open Source: The source code is available as it is under Free and Open Source Software(FOSS).

60. What are the features of the Linux operating system?

Following are the features of the Linux Operating System


Home About us 
Courses 
Student Portal 
Careers 
Events 
Hire
Portable: Software can work on different types of hardware in the same way. It can carry easily in
pen drives and memory cards.

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.

Multiprogramming: Multiple programs or applications can run at the same time.

Shell: It has a special interpreter program where you can execute programs and commands of
the system.

Security: It provides authentication, authorization, and encryption to provide security to the


data.

61. Differentiate between BASH and DOS?

Difference between Bash and Dos

Bash Dos

Commands are case sensitive commands are not case sensitive

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.

62. What is meant by internal commands and external commands?


Contact us 
Internal Commands: Commands directly run by the shell are known as internal commands and
there is no separate process to run the commands. Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 19/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

External Commands: Commands which


 are run by the kernel are known as external commands
[email protected]
and every single command has its own unique process id.
Refer your friends and earn 10% the first time they enroll! Invite Now

63. Enlist some Linux distributors (Distros) along with their usage.

We have so many Linux Distributors, among them, we discuss a few important ones.

Linux Mint: It is stable


Home About us  andCourses
robust. Linux
 Mint uses mate desktop
Student Portal  and cinnamon.
Careers 
Events 
Hire
Debian: It stands for robustness, stability, and a well-oiled release cycle. It is user-friendly. Debian
version 8 will be replaced by version 9.

Ubuntu: It is available for both desktop and server editions and is based on Debian.

openSUSE: It is a good choice for new users and existing users.

Manjaro: It gives a pleasant experience for new and experienced users.

Linux Networking Interview Questions


YouTube Display Ad 3 page 0001 14

64. What is meant by PIPE in Linux?

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:

command_1 | command_2 | command_3 | .... | command_N

65. Explain the features of a Stateless Linux Server.

Features of Stateless Linux Server

1. Stores the prototype of every system.

2. Stores the snapshot was taken.

3. Stores the home directories.

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.

69. What is a Stateless Linux Server?

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?

Linux is an Open-Source Operating System, nowadays it is rapidly growing in the Technology


market. We have a few reasons why Linux is more secure than other OS.

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

71. What is the cat command inLinux?


[email protected]

In Linux cat command concatenates


Refer and
your friends and prints
earn 10% files. Users
the first time might issueInvite
they enroll! cat to check the contents of
Now

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

72. What is the tail command in Linux?

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:

$ tail -n 100 /var/log/httpd/access_log

73. What is the grep command in Linux?

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:

$ cat tomcat.log | grep org.apache.catalina.startup.Catalina.start


12-Jan-2018 17:08:35.542 INFO [main] org.apache.catalina.startup.Catalina.start
Server startup in 681 ms

YouTube Banner Ad 2 page 0001 12

74. What Contact


is the df
us -i command? 
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 22/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

df -I command shows free inodes on mounted filesystems.


[email protected]

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

$ ps -ef $ ps -ef | grep tomcat

76. What is the top Command in Linux?

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.

77. What is the df command in Linux?

Users can use the df command to troubleshoot disk space issues. Here df stands for display-free disk
space.

df Command Example:

df -h

78. What is the difference between Linux and Windows?

Linux Windows

Linux is available for FREE It is paid software

It is an Open-Source operating system It is not an open-source OS

Linux customization is possible No customizations are available

Can’t defend against virus and malware attacks


It provides high-level security
unless it is paid

Primary partitioning and logical partitioning


Contact us Booting is available while primary partitioning 
available to boot only.
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 23/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

BackSlash separates directories  [email protected]


The forward slash separates directories

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

79. What is the iptables command in Linux?

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.

80. What is the netstat command in Linux?

netstat command in Linux shows the network status. This netstat command shows network ports in
use and their incoming connections.

81. What is a du command in Linux?

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

82. What is the lsof command in Linux?

ls of command lists the open files associated with your application.

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

85. What does (cd dir && command) do?

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.

Youtube Banner Ads 3 1 page 0001 14

86. What does the push command do?

push the command and put the current dir on the stack so you can pop back to it.

87. How do you get the full path of a file in Linux?

Use this command: readlink -f file.txt

88. What is the du -s * | sort -k1,1rn | head command used for?

This command shows top disk users in the current dir.

89. What does the cd command do?

Go to the $HOME directory

90. How do you list the contents of tar.gz and extract only one file?

Use these commands:

· tar tf file.tgz
· tar xf file.tgz filename

91. How do you find who is logged in?

Use this command to find who logged in: w


Contact us 
92. What is fdisk -l command used for? Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 25/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

fdisk -I command show disks partitions sizes and types (run as root).
[email protected]

93. How do youRefer


checkyour friends and earn 10% the first time they enroll! Invite Now
the permissions of each directory to a file?

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?

This command sorts paths by easy-to-interpret disk usage.

YouTube Display Ad 3 page 0001 15

95. How do you check resource usage?

Use this command to check resource usage: /usr/bin/time -v ls

96. How do you run the command every time a file is modified?

Use this command to do:

while inotifywait -e close_write document.tex


do
make
done

97. How to copy text to the clipboard?

Use this command: cat file.txt | xclip -selection clipboard.

98. What is the df -h command?

This command shows free space on mounted file systems.

99. What is the env command in Linux?


Contact us 
env command allows users to set or print the environment variables. During troubleshooting, users
can find it useful for checking if the wrong environment variable prevents your applicationTrusted
from Site
https://datavalley.ai/top-linux-interview-questions/ 26/31
1/21/25, 11:30 AM Top 100+ Linux Interview Question And Answers In 2023

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?

Use this command: comm file1 file2.

YouTube Display Ad 3 page 0001 16

101. What does the cd – command do?

cd- command go to the previous directory.

102. What is the ls -lSr command?

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?

Use this command: timeout 10s ./script.sh


Search… 

# Restart every 30 minutes


Categories
while true; do timeout 30m ./script.sh; done

Artificial Intelligence (5)

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  [email protected] (17)

Azure DevOps Refer your friends and earn 10% the first time they enroll! Invite Now (5)

BigData (8)

Block Chain (2)

Business Intelligence (11)


Home About us 
Courses 
Student Portal 
Careers 
Events 
Hire
Career (4)

Cheat Sheet (10)

Cloud Computing (152)

Computing Library (1)

Data Engineering (27)

Data Science (30)

Database Management System (23)

DevOps (77)

ETl Testing (2)

GCP (2)

IT Infrastructure (1)

Java Full Stack (4)

Machine Learning (8)

Operating System (4)

Programming Language (35)

Python (69)

Software Development (20)

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

[email protected]

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

Join Our Community

News

Work With Us

Job Openings

Become an Instructor

Courses

Data Engineering

AWS Solutions Architect

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

Terms of Use Privacy Policy

Home About us  Courses  Student Portal  Careers  Events  Hire

Contact us 
Trusted Site
https://datavalley.ai/top-linux-interview-questions/ 31/31

You might also like