Top 50 Linux Interview Questions and Answers in 2022 - Edureka
Top 50 Linux Interview Questions and Answers in 2022 - Edureka
Omkar S Hiremath
Tech Enthusiast in Blockchain, Hadoop, Python, Cyber-Security, Ethical Hacking. Interested in anything...
Did you know that more than 90% of the World’s Fastest Computers use Linux? No doubt why! Linux is fast, powerful, and a
techies’ favorite. If you are looking to become a Linux Administrator, then this is the right place for you to prepare for the
interview. In this article, I will be discussing some of the most common and important Linux Interview Questions and their
Answers.
This Linux Interview Questions blog is divided into two parts: Part A-Theoretical Questions and Part B-Scenario Based
Questions. Let’s get started!
1. What is Linux?
Linux is an Open-Source Operating System based on Unix. Linux was first introduced by Linus Torvalds. The main purpose of
Linux was to provide free and low-cost Operating System for users who could not afford Operating Systems like Windows or iOS
or Unix.
Both free distributions and paid distributions Different levels of UNIX have a
Price
are available. different cost structure
Ext2, Ext3, Ext4, Jfs, ReiserFS, Xfs, Btrfs, jfs, gpfs, hfs, hfs+, ufs, xfs,
File System Support
FAT, FAT32, NTFS. zfs,vxfs.
Portability Yes No
Examples
Ubuntu, Fedora, Red Hat, Kali Linux, Debian,
Archlinux, Android, etc.
OS X, Solaris, All Linux
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 1/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
4. What is LILO?
Signup with Facebook
LILO stands for LInux LOader. LILO is a Linux Boot Loader that loads Linux Operating System into the main memory to begin
execution. Most of the computers come with boot loaders for certain versions of Windows or Mac OS. So, when you want to use
Already have an account? Sign in.
Linux OS, you need to install a special boot loader for it. LILO is one such boot loader.
When the computer is started, BIOS conducts some initial tests and transfers control to the Master Boot Record. From here, LILO
loads the Linux OS and starts it.
The advantage of using LILO is that it allows fast boot of Linux OS.
Kernel: It is the core component of the Operating System that manages operations and hardware.
Shell: Shell is a Linux interpreter which is used to execute commands.
GUI: GUI stands for Graphical User Interface which is another way for a user to interact with the system. But unlike CLI,
GUI consists of Images, Buttons, TextBoxes for interaction.
System Utilities: These are the software functions that allows the user to manage the computer.
Application Programs: Software programs or set of functions designed to accomplish a specific task.
6. Which are the Shells used in Linux?
The most common Shells used in Linux are
Sl.
BASH DOS
no.
1. Commands are case-sensitive. Commands are not case-sensitive.
‘/’ (forward slash) is used as a
Top 50 Linux Interview Questions For Beginners In 2022 slash) is used as command argument
‘/’ (forward
e! directory separator.
edureka.co
delimiter.
2.
” (backslash) is used as an escape
” (backslash) is used as a directory separator.
character.
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 2/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
9. What command would you use to check how much memory is being used by Linux?
You can use any of the following commands:
Subscribe to our Newsletter, and get personalized recommendations.
×
free -m
Sign up with Google
vmstat
top
htop Signup with Facebook
10. Explain file permission in Linux.
There are 3 kinds of permission in Linux: Already have an account? Sign in.
You can change the permission of a file or a directory using the chmodcommand. There are two modes of using the chmod
command:
1. Symbolic mode
2. Absolute mode
Symbolic mode
The general syntax to change permission using Symbolic mode is as follows:
For example, if you want to set the permission such that the user can read, write, and execute it and members of your group
can read and execute it, and others may only read it.
Absolute mode
The general syntax to change permission using Absolute mode is as follows:
The Absolute mode follows octal representation. The leftmost digit is for the user, the middle digit is for the user group and the
rightmost digit is for all.
Below is the table that explains the meaning of the digits that can be used and their effect.
0 No permission ––
–
Top 50 Linux Interview Questions For Beginners In 2022
e! edureka.co
1 Execute permission ––
x
2 Write permission –w
Whatsapp Linkedin Twitter Facebook – Reddit
3
Copy Link
Execute and write permission: 1 (execute) + 2 (write) = 3 –
wx
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 3/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
$ chmod 754 filename
Syntax: $ pwd
ls: Lists all the files and directories in the present working directory.
Syntax: $ ls
1. Switching Desktops
2. Oversized Desktops
Switching Desktops
In the case of Switching Desktops, you can create discrete virtual desktops to run programs. Here, each virtual desktop will
behave as an individual desktop and the programs running on each of these desktops is accessible only to the users who are
using that particular desktop.
Oversized Desktops
Top 50 Linux Interview Questions For Beginners In 2022
e! Oversized
edureka.coDesktops do not offer a discrete virtual desktop but it allows the user to pan and scroll around the desktop that is
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 4/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Example:
This command will print the count of the word “linux” in the “interview.txt” file.
$ ls <options>
Whatsapp <directory> Linkedin Twitter Facebook Reddit
For example, if you want to list all the files in the Example directory, then the command will be as follows:
Copy Link
$ ls Example/
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 5/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
There are different options that can be used with the ls command. These options give additional information about the file/
folder. For example:
‘>’ overwrites the existing content of the file or creates a new file.
‘>>’ appends the new content to the end of the file or creates a new file.
Now when you use the ‘>’ redirection operator, the contents of the file are overwritten.
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 6/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Suppose you want to extract all the files from the archive named sample.tar.gz, then the command will be:
Suppose you want to create an archive of all the files stored in the path /home/linux/, then the command will be:
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 7/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
If you want to list the entries that start with the character ‘a’, then the command would be:
If you want to list the entries that start has the character ‘n’, then the command would be:
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 8/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
25. What is the minimum number of disk partitions required to install Linux?
The minimum number of partitions required is 2.
One partition is used as the local file system where all the files are stored. This includes files of the OS, files of applications and
services, and files of the user. And the other partition is used as Swap Space which acts as an extended memory for RAM.
$ cp <source> <destination>
Suppose you want to copy a file named questions.txt from the directory /new/linux to /linux/interview, then the command
will be:
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 9/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
ADMINISTRATION FUNDAMENTALS SCRIPTING
CERTIFICATION CERTIFICATION CERTIFICATION
TRAINING COURSE TRAINING TRAINING
Subscribe to our Newsletter, and get personalized recommendations.
×
Linux Administration
Linux Fundamentals
Sign up with Google Unix Shell Scripting
Certification Training
Certification Training Certification Training
Course
Reviews Reviews Signup with Facebook Reviews
5(11778) 5(9895) 5(4333)
$ ps
Suppose the process id of the process you want to terminate is 3849, then you will have to terminate it like this:
$ kill 3849
$ mv <oldname> <newname>
$ cp <oldname> <newname>
$ rm <oldname>
$ mount -l
Suppose you want to find the locations of a file name sample.txt, then your command would be:
$ locate sample.txt
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 10/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
8. Write a bash script to delete all the files in the current directory that contains the word “linux”.
for i in *linux*; do rm $i; done
$ touch <filename>
Suppose you want to create a file named sample.txt, then the command would be:
$ touch sample.txt
rmdir
rm -rf
Note: The command rm -rf should be used carefully because it will delete all the data without any warnings.
The cron command is used to repeatedly schedule a task at a specific time. The tasks are stored in a cron file and then executed
using the cron command. The cron command reads the string from this file and schedules the task. The syntax for the string to
enter in the cron file is as follows:
Suppose you want to run a command at 4 pm every Sunday, then the string would be:
0 16 * * 0 <command>
Top 50 Linux Interview Questions For Beginners In 2022
e! edureka.co
The at command is used to schedule a task only once at the specified time.
Suppose you want to shut down the system at 6 pm today, then the command for this would be:
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 11/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
If you don’t unmount the floppy disk, then the data might become corrupted.
$ echo $SHELL
16. How can you login to another system in your network from your system?
SSH can be used for this. The Syntax is as follows:
Suppose you want to login into a system with IP address 192.168.5.5 as a user “mike”, then the command would be:
$ ssh [email protected]
17. How would you open a file in read-only mode using the vim editor?
$ vim -R <filename>
18. How would you search for a specific Employee ID in a file using the vim editor?
$ vim +/<employee id to be searched> <filename>
20. How do you sort the entries in a text file in ascending order?
This can be done using the sort command.
$ sort sample.txt
$ service --status-all
Copy Link
24. How do you start and stop a service?
To start:
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 12/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
To stop:
$ service <servicename> start Subscribe to our Newsletter, and get personalized recommendations.
×
25. Explain the free command. Sign up with Google
This command is used to display the free, used, swap memory available in the system.
Typical free command output. The output is displayed in bytes. Signup with Facebook
I hope these Linux Interview Questions will help you perform well in your interview. And I wish you all the best!
Got a question for us? Please post it on Edureka Community and we will get back to you.
If you wish to learn Linux Administration and build a colorful career, then check out our Linux
Administration Training which comes with instructor-led live training and real-life project experience. This training will help you
understand Linux Administration in depth and help you achieve mastery over the subject.
Copy Link
Training Course SAT&SUN (Weekend Batch) View Details
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 13/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Watch Now
What is Linux Mint and how is Linux Tutorial: Everything You Top 50 Linux Interview Unix vs Linux: Differ
it better than Ubuntu? Need To Know To Get Started Questions For Beginners In Comparison
With Linux 2022
‹›
Comments 2 Comments
Reply
Ven says:
Jun 18, 2020 at 8:28 am GMT
Thank you, great Q&A for the interview. I’ve found a mistake where the command to stop a service is actually to start, just a note:
To stop:
Thanks.
Top 50 Linux Interview Questions For Beginners In 2022
e! edureka.co
Reply
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 14/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Browse Categories
Artificial Intelligence BI and Visualization Big Data Blockchain Cloud Computing Cyber Security Data Science
Data Warehousing and ETL Databases DevOps Digital Marketing Enterprise Front End Web Development
Human Resource Management Mobile Development Operations Management Product Management Programming & Frameworks
Project Management and Methodologies Robotic Process Automation Software Testing Supply Chain Management
TRENDING CERTIFICATION COURSES TRENDING MASTERS COURSES
DevOps Certification Training Data Scientist Masters Program
e! AWSTop 50 Linux
Architect
edureka.co
Interview
Certification Questions For Beginners In 2022
Training DevOps Engineer Masters Program
Big Data Hadoop Certification Training Cloud Architect Masters Program
Tableau Training & Certification Big Data Architect Masters Program
Python Certification Training for Data Science Machine Learning Engineer Masters Program
Selenium Certification Training Full Stack Web Developer Masters Program
Whatsapp Linkedin Twitter Facebook Reddit
PMP® Certification Exam Training Business Intelligence Masters Program
Copy
Robotic Process Automation Training using UiPath
LinkSpark and Scala Certification Training
Apache
Data Analyst Masters Program
Test Automation Engineer Masters Program
Microsoft Power BI Training Post-Graduate Program in Artificial Intelligence & Machine Learning
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 15/16
9/26/22, 12:03 PM Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Online Java Course and Training Post-Graduate Program in Big Data Engineering
Python Certification Course
CATEGORIES
CATEGORIES
Cloud Computing DevOps Big Data Data Science BI and Visualization Programming & Frameworks Software Testing
Project Management and Methodologies Robotic Process Automation Frontend Development Data Warehousing and ETL Artificial Intelligence
Blockchain Databases Cyber Security Mobile Development Operating Systems Architecture & Design Patterns Digital Marketing
© 2022 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved. Terms & Conditions
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of
MongoDB, Inc.
Copy Link
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 16/16