Top 150 Linux interview questions and answers.
- What is Linux? - An open-source Unix-like operating system.
- Who created Linux? - Linus Torvalds.
- What is a kernel? - The core component of Linux.
- What is GNU/Linux? - The Linux kernel plus GNU tools.
- Why is Linux popular? - It is open source, stable, and secure.
- What is a distribution (distro)? - A packaged version of Linux.
- Examples of Linux distros? - Ubuntu, Arch Linux, Debian, Fedora.
- What is a shell? - A command-line interpreter.
- Popular shells? - Bash, Zsh, Fish.
- What is a terminal? - An interface to interact with the shell.
- What is the Linux file system? - A hierarchical directory structure.
- Root directory? -
/ - Home directory? -
/home - Root user home? -
/root - Configuration files? -
/etc - User programs? -
/usr - Temporary files? -
/tmp - Variable data? -
/var - Device files? -
/dev - Boot files? -
/boot
pwd? - Print current directory.ls? - List files.cd? - Change directory.mkdir? - Create directory.rmdir? - Remove empty directory.rm? - Delete files.cp? - Copy files.mv? - Move or rename files.touch? - Create an empty file.clear? - Clear the terminal.
cat? - Display file content.less? - View file page by page.more? - Basic file viewer.head? - Show first lines of a file.tail? - Show last lines of a file.tail -f? - Live log monitoring.nano? - Terminal text editor.vim? - Advanced text editor.wc? - Count words and lines.file? - Identify file type.
- Who is the current user? -
whoami - Add user? -
useradd - Delete user? -
userdel - Change password? -
passwd - Switch user? -
su - Execute as root? -
sudo - List users? -
cat /etc/passwd - User ID? - UID
- Group ID? - GID
- Root user UID? -
0
- What are Linux permissions? - Read, write, and execute.
- Read permission? -
r - Write permission? -
w - Execute permission? -
x - Check permissions? -
ls -l - Change permissions? -
chmod - Change ownership? -
chown - Change group? -
chgrp - Permission
777? - Full access. - Permission
755? - Owner full, others read and execute.
- What is a process? - A running program.
- Show running processes? -
ps - Detailed processes? -
top - Modern alternative? -
htop - Process ID? - PID
- Kill process? -
kill PID - Force kill? -
kill -9 PID - Background process? -
command & - Foreground process? - Active terminal process.
- Show jobs? -
jobs
- Check IP address? -
ip addr - Old command? -
ifconfig - Test connectivity? -
ping - DNS lookup? -
nslookup - Route information? -
ip route - Download files? -
wget - Alternative download tool? -
curl - Open ports? -
ss -tuln - SSH? - Secure Shell.
- SSH port? -
22
- Ubuntu package manager? -
apt - Update packages? -
apt update - Upgrade packages? -
apt upgrade - Install package? -
apt install - Remove package? -
apt remove - Arch package manager? -
pacman - Update Arch Linux? -
pacman -Syu - Fedora package manager? -
dnf - Search package? -
apt search - Package information? -
apt show
- Show disk usage? -
df -h - Show folder size? -
du -sh - List partitions? -
lsblk - Mount file system? -
mount - Unmount file system? -
umount - What is swap? - Disk-based virtual memory.
- Show memory usage? -
free -h - Disk partition tool? -
fdisk - Modern partition tool? -
parted - What is LVM? - Logical Volume Manager.
grep? - Search text.find? - Search files.locate? - Fast file search.awk? - Text processing.sed? - Stream editor.xargs? - Build command arguments.sort? - Sort text.uniq? - Remove duplicates.cut? - Extract columns.tr? - Translate characters.
- What is a shell script? - A file containing shell commands.
- Script extension? -
.sh - Execute script? -
bash script.sh - Make executable? -
chmod +x - Print text? -
echo - Read input? -
read - Conditional statement? -
if - Loop types? -
for,while - Function in Bash? - A reusable code block.
- Variables? - Store values.
- What is systemd? - Linux service manager.
- Start service? -
systemctl start - Stop service? -
systemctl stop - Restart service? -
systemctl restart - Service status? -
systemctl status - Enable service? -
systemctl enable - Disable service? -
systemctl disable - View logs? -
journalctl - Boot logs? -
journalctl -b - List services? -
systemctl list-units
- Linux vs Windows?
- What is kernel?
- What is shell?
- What is root user?
chmodvschown?- Process vs thread?
- What is SSH?
- What is a cron job?
- What is systemd?
- What is swap memory?
lscdpwdgrepfindcatchmodchownpskill
- Linux basics
- Kernel
- Shell
- File system
- Commands
- Users
- Groups
- Permissions
- Processes
- Networking
- SSH
- Package management
- Disk management
-
grep -
find -
awk -
sed - Bash scripting
- systemd
- Logs
End of Linux handbook.