Welcome to the Linux Course Interview Questions and Answers guide. In this resource, we will provide you with a basic intro to some common interview questions and their answers related to Linux. Whether you’re preparing for a job interview in the field of Linux system administration or simply looking to brush up on your Linux knowledge, these questions and answers will help you gain confidence and expertise.Linux Interview Questions
Q1 What are the Advantages of Linux
Ans-Linux free operating system and a lot of open-source utilities are available, so the total cost of ownership is much lower.
Linux is a secure operating system. Eg: – We can use Linux without Antivirus
Requires less reboots compared to Windows.
Linux is a robust OS.
Everything gets saved in files. So troubleshooting is easier compared with Windows.
Q2 List some Linux Distributions
- Some Linux distributions are listed here:
- Ubuntu
- Debian
- CentOS|
- Fedora
- RedHat
- Kali
- Suse
- Ruby
- Amazon Linux
Q3 Elaborate all the file permissions in Linux.
There are three file permissions
- Read Users open and read files with this permission.
- Write: Users can open and modify the files.
- Execute: Users can run the file.
Q4 Differences between Kernel and Shell
Ans- The kernel is nothing but an operating system. The kernel does all the functions of operating systems. But the kernel understands low-level language (e.g.- Assembly level language)
Shell is an interpreter who converts instruction in High-level language (e.g.:- Java, C, C sharp, Python) into kernel-understandable language. We will have a single kernel at a time. But we may have multiple shells in the system at a time.
Q 5 What is a root user account?
Ans- The root is like a system administrator account in Linux. The root account provides complete system control, root account has full access.
Q6 What is Swap Space?
Ans- Swap space is the page memory or virtual memory. We can configure hard disk space as swap memory. Swap space also helps to increase system speed.
Q7 What is the inode number in Linux?
Ans- We refer file using its name, but the system identifies it using its inode number. The system has a pool of inode numbers. When we create a file an inode number gets associated with it. But when we delete the filename, the inode number gets free.
Q8 How to view hidden files?
By using ls -a.
Files starting with dot (.) are called hidden files.
Q9 What is. and .. directory in Linux?
Ans- . represent current directory
.. represent parent directory
Q10 What are the different modes when using the vi editor?
The 3 different kinds of modes in the vi editor are listed below:
- Command Mode/ Regular Mode
- Insert Mode/ Edit Mode
- Ex Mode/ Replacement Mode
Q11 What is the range of UID and GID in Linux?
Ans-UID and GID range: – 0 to 999 are reserved for the system.
From 1000 onwards is used for users
Q12 Explain commands user add, groupadd, chmod, top, ps, man, userdel, id, groups
Ans- user add :- We can add a user to the Linux system
#useradd <username>
groupadd: – We can add a group account in the Linux system
#groupadd <groupname>
chmod :- used to assign permission to data
#chmod a=rwx <filename>
top:- shows repetitive process update display
#top
ps:- show process status
#ps
#ps -a
#ps -aux
#ps lax
Man:- shows command manual pages
#man cp
userdel :- delete a user account
#userdel <username>
#userdel -r <username> :- delete user along with its data
id:- shows user belongs to which groups, along with its ID and group IDs
#id <username>
groups:- shows user belongs to which groups
#groups <username>
Q13 Describe ls -l.
Q14 What happens when creating a new user in the system?
- The user account gets created and its entries get created in the/etc/password and /etc/shadow file
- The home directory will get created as /home/<username>
- Some hidden files are copied in the home directory which sets the user environment.
- User mail spool gets created as /var/spool/mail/<username>
- A group account of the same name gets created. And that user is a primary member of the group
15 How to check IP address details?
Ans- #ip addr