- Devops Diaries
- Posts
- 50 Linux Questions - Must to Know
50 Linux Questions - Must to Know
Here are 50 important AWS interview questions and answers, covering basic to advanced concepts:

Basic Level Questions
What is Linux?
Linux is an open-source, Unix-like operating system based on the Linux kernel. It is widely used for servers, desktops, and embedded systems.What are the key components of the Linux OS?
· Kernel
· Shell
· System Utilities
· Applications
What are the different types of Linux distributions?
Popular Linux distributions include Ubuntu, CentOS, Fedora, Debian, and Arch Linux.How do you check the Linux version you are using?
uname -r
cat /etc/os-release
What is the difference between Linux and Unix?
Linux is open-source and free, while Unix is a proprietary operating system with different variants like AIX, Solaris, and HP-UX.What are inodes in Linux?
Inodes store metadata (permissions, ownership, timestamps) of files and directories but not the content or filename.How do you list all files, including hidden ones, in a directory?
ls -a
How do you display the current working directory?
pwd
What is the difference between cp and mv commands?
· cp copies files, keeping the original.
· mv moves files, deleting the original.
How do you create a new user in Linux?
sudo useradd username
sudo passwd username
Intermediate Level Questions
How do you change file permissions in Linux?
chmod 755 filename
What is the purpose of the chmod command?
It is used to change read, write, and execute permissions on files and directories.What is the difference between hard and symbolic links?
Hard links point to the same inode and share data.
Symbolic links are shortcuts referencing another file.
How do you check disk space usage in Linux?
df -h
How do you find a file in Linux?
find /path -name "filename"
What is a process in Linux?
A process is an instance of a running program with its own allocated memory and resources.How do you kill a running process?
kill -9 PID
What does the ps command do?
It displays the currently running processes in the system.How do you monitor system performance in real-time?
top
htop
How do you check memory usage in Linux?
free -m
What is the difference between cron and anacron?
cron runs scheduled tasks when the system is running.
anacron runs missed tasks once the system is up.
How do you schedule a cron job?
crontab -e
What is the command to extract a tar.gz file?
tar -xvzf file.tar.gz
What does the grep command do?
It searches for patterns in files using regular expressions.How do you switch users in Linux?
su - username
Advanced Level Questions
What is the difference between a soft and hard limit in ulimit?
Soft limit can be increased by users.
Hard limit can only be increased by root.
What is a zombie process in Linux?
A process that has completed execution but whose parent has not yet read its exit status.How do you troubleshoot high CPU usage in Linux?
Use top, htop, or ps aux --sort=-%cpu to analyze running processes.How do you mount a filesystem in Linux?
mount /dev/sdX /mnt
What is LVM in Linux?
Logical Volume Manager (LVM) provides flexible disk management by allowing dynamic resizing of partitions.How do you extend an LVM partition?
lvextend -L +10G /dev/mapper/volgroup-lvname
resize2fs /dev/mapper/volgroup-lvname
What is the purpose of /etc/fstab?
It defines how disk partitions should be mounted at boot time.What are namespaces in Linux?
Namespaces provide process isolation, which is a core feature of containerization.How do you create a swap file in Linux?
dd if=/dev/zero of=/swapfile bs=1G count=4
mkswap /swapfile
swapon /swapfile
How do you troubleshoot network issues in Linux?
Use ping, netstat, traceroute, and ifconfig commands.How does Linux handle permissions with ACLs?
Using getfacl and setfacl to manage fine-grained permissions.What is a kernel panic?
A fatal error in the Linux kernel, usually caused by hardware or driver issues.What is SELinux and why is it used?
Security-Enhanced Linux (SELinux) is a security module that enforces mandatory access controls.How do you enable/disable a service in systemd?
systemctl enable service
systemctl disable service
What is the difference between systemd and init?
systemd is a modern service manager that replaces the traditional init system with faster boot times and improved dependency management.How do you set up a firewall in Linux?
Using iptables or firewalld to allow/deny traffic.What is a kernel module?
A piece of code that can be dynamically loaded into the Linux kernel to extend its functionality.How do you list open ports in Linux?
netstat -tuln
What is SSH and how does it work?
SSH (Secure Shell) is a protocol for secure remote login and command execution.How do you create a symbolic link?
ln -s target linkname
How do you debug boot issues in Linux?
Using journalctl -xb to analyze boot logs.What is the difference between TCP and UDP?
TCP is connection-oriented and reliable, while UDP is connectionless and faster.What are cgroups in Linux?
Control Groups (cgroups) limit and monitor resource usage of processes.What does the nohup command do?
Runs a command immune to hangups, allowing it to continue after logout.How do you view logs in Linux?
tail -f /var/log/syslog
Reply