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
Yes, it is legal to edit Linux Kernel. Linux is released under the General Public License (General Public License). Any project
released under GPL can be modified and edited by the end users.
4. What is LILO?
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 1/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
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 Become a Certified
loaders Professional
for certain versions ofWindows or Mac OS. So, when you want to use
Linux OS, you need to install a special boot loader for it. LILO is one such boot loader.
Subscribe to our Newsletter, and get personalized recommendations.
×
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. Sign up with Google
The advantage of using LILO is that it allows fast boot of Linux OS.
Signup with Facebook
5. What are the basic components of Linux?
The basic components of Linux are:
Already have an account? Sign in.
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
‘/’ (forward slash) is used as command argument
directory separator.
delimiter.
2.
” (backslash) is used as an escape
” (backslash) is used as a directory separator.
character.
9. What command would you use to check how much memory is being used by Linux?
You can use any of the following commands:
free -m
vmstat
top
htop
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 2/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
1. Symbolic mode
2. Absolute mode Already have an account? Sign in.
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 ––
–
1 Execute permission ––
x
2 Write permission –w
–
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 3/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
For example, if you want to set the permission such that the user can read, write, and execute it and members of your group
Become
can read and execute it, and others may only read it. a Certified Professional
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
Oversized Desktops do not offer a discrete virtual desktop but it allows the user to pan and scroll around the desktop that is
larger in size than the physical screen.
Explore Curriculum
16. What are the process states in Linux? Signup with Facebook
The process states are as follows:
Already have an account? Sign in.
Ready: The process is created and is ready to run
Running: The process is being executed
Blocked or wait: Process is waiting for input from the user
Terminated or Completed: Process completed execution, or was terminated by the Operating System
Zombie: Process terminated, but the information still exists in the process table.
17. Explain grep command.
Grep stands for Global Regular Expression Print. The grep command is used to search for a text in a file by pattern matching
based on regular expression.
Example:
This command will print the count of the word “linux” in the “interview.txt” file.
$ ls <options> <directory>
For example, if you want to list all the files in the Example directory, then the command will be as follows:
$ ls Example/
There are different options that can be used with the ls command. These options give additional information about the file/
folder. For example:
‘>>’ appends the new content to the end of the file or creates a new file.
Become a Certified Professional
Suppose the content of the file is as follows:
×
Subscribe to our Newsletter, and get personalized recommendations.
Now when you use the ‘>’ redirection operator, the contents of the file are overwritten.
Already have an account? Sign in.
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 6/15
21/03/2022 11:23 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:
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 7/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
If you want to list the entries that start has the character ‘n’, then the command would be:
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.
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 8/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
$ cp <source> <destination>
Signup with Facebook
Suppose you want to copy a file named questions.txt from the directory /new/linux to /linux/interview, then the command
will be:
Already have an account? Sign in.
$ cp questions.txt /new/linux /linux/interview
ADMINISTRATION FUNDAMENTALS SCRIPTING
CERTIFICATION CERTIFICATION CERTIFICATION
TRAINING COURSE TRAINING TRAINING
Linux Administration
Linux Fundamentals Unix Shell Scripting
Certification Training
Certification Training Certification Training
Course
Reviews Reviews Reviews
5(10983) 5(9512) 5(4137)
$ 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
6. How to find where a file is stored in Linux?
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 9/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
You can use the locate command to find the path to the file.
Become a Certified Professional
Suppose you want to find the locations of a file name sample.txt, then your command would be:
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>
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 10/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
12. Suppose you try to delete a file using the rm command and
Signthe deletion
up with Googlefails. What could be the possible reason?
The path specified to the file or the file name mentioned might be wrong
The user trying to delete the file might not have permissions to delete the file.
Signup with Facebook
13. How do you look at the contents of a file named sample.z?
The .z extension means that the file has been compressed. To look at the contents
Already ofaccount?
have an the compressed
Sign in. file, you can use
the zcat command. Example:
$ zcat sample.z
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
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 11/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
To stop:
$ free
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.
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 12/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
Linux Administration : Past,
Present & is the Future
Watch Now
Linux Tutorial: Everything You Unix vs Linux: Difference and What is Linux Mint and how is How to Install Ubunt
Need To Know To Get Started Comparison it better than Ubuntu? Complete Guide
With Linux
‹›
Comments 1 Comment
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.
Reply
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 13/15
21/03/2022 11:23 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 Mobile Development
Programming & Frameworks Project Management and Methodologies Robotic Process Automation Software Testing
TRENDING CERTIFICATION COURSES TRENDING MASTERS COURSES
DevOps Certification Training Data Scientist Masters Program
AWS Architect Certification 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
PMP® Certification Exam Training Business Intelligence Masters Program
Robotic Process Automation Training using UiPath Data Analyst Masters Program
Apache Spark and Scala Certification Training Test Automation Engineer Masters Program
Microsoft Power BI Training Post-Graduate Program in Artificial Intelligence & Machine Learning
Online Java Course and Training Post-Graduate Program in Big Data Engineering
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 14/15
21/03/2022 11:23 Top 50 Linux Interview Questions and Answers in 2022 | Edureka
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.
https://www.edureka.co/blog/interview-questions/linux-interview-questions-for-beginners/ 15/15