Basic Linux Interview Questions
1. What is Linux?
Linux is an open-source operating system kernel originally created by Linus Torvalds. It is
based on Unix and designed for use on a wide range of computer hardware, from personal
computers to servers.
2. What is the difference between Linux and Unix?
Linux is an open-source operating system kernel, while Unix refers to a family of operating
systems that includes various proprietary and open-source implementations.
3. What is a shell in Linux?
A shell is a command-line interface that allows users to interact with the operating system by
typing commands. The most common shell in Linux is the Bash shell (Bourne Again Shell).
4. What is the root user in Linux?
The root user, also known as the superuser, has unrestricted access to all commands and files
on a Linux system. It is similar to the administrator account in Windows.
5. What is a distribution in Linux?
A Linux distribution, or distro, is a collection of software packages built on top of the Linux
kernel. It includes system utilities, libraries, and applications to provide a complete operating
system.
6. What is the difference between a package manager and a repository?
A package manager is a tool used to install, update, and manage software packages on a
Linux system. A repository is a collection of software packages and metadata that is
accessible over a network, typically provided by the distribution.
7. How do you check the IP address of a Linux system?
You can use the ifconfig or ip addr command to view the IP address of a Linux system.
8. What is SSH?
SSH (Secure Shell) is a cryptographic network protocol used for secure remote login, remote
command execution, and other secure network services between two networked computers.
9. How do you change file permissions in Linux?
You can use the chmod command to change file permissions in Linux. For example, chmod
755 [Link] would give read, write, and execute permissions to the owner and read and
execute permissions to others.
10. What is the purpose of the sudo command?
The sudo command allows users to execute commands with the security privileges of another
user, typically the root user.
11. What is a symbolic link in Linux?
A symbolic link, also known as a symlink, is a special type of file that points to another file or
directory. It is similar to a shortcut in Windows.
12. What is the difference between a hard link and a symbolic link?
A hard link points directly to the inode of a file, while a symbolic link points to the path of a
file. Additionally, a hard link cannot cross filesystem boundaries, whereas a symbolic link
can.
13. What is a process in Linux?
A process is a program in execution. It consists of the program code, data, and resources such
as memory and CPU time.
14. How do you kill a process in Linux?
You can use the kill command to terminate a process in Linux. First, you need to find the
process ID (PID) using the ps command, then use kill PID to terminate it.
15. What is a shell script in Linux?
A shell script is a text file containing a series of shell commands that are executed in
sequence. It allows users to automate tasks and perform complex operations.
16. How do you check disk space usage in Linux?
You can use the df command to check disk space usage in Linux. Adding the -h option makes
the output human-readable.
17. What is the difference between grep and awk?
grep is a command-line utility for searching text patterns in files, while awk is a versatile
programming language for processing text files.
18. What is the purpose of the cron utility?
The cron utility is used to schedule tasks to run periodically at fixed times, dates, or intervals.
19. How do you install software from source in Linux?
To install software from source in Linux, you typically download the source code, extract it,
configure the build options, compile it with make, and install it with make install.
20. What is a kernel in Linux?
The kernel is the core component of the Linux operating system. It manages the system's
resources, such as memory, CPU, and devices, and provides essential services to higher-level
software.