BASICS – FILE SYSTEM, COMMANDS, FILES
1. What is Linux?
Linux is a Unix-like open-source operating system kernel that manages system resources and
enables interaction between hardware and software.
2. Difference between Linux and Unix?
Unix is proprietary, while Linux is open-source. Linux is more portable and supports a wide
variety of hardware.
3. What is a Linux kernel?
The kernel is the core part of the OS that manages CPU, memory, devices, and system calls.
4. What are inodes?
Inodes store metadata about files like ownership, permissions, timestamps, and file location
(not the name).
5. How to check current directory?
pwd
6. How to list hidden files?
ls -a
7. How to see file permissions?
ls -l
8. What does chmod 755 mean?
Owner has full (7), group and others have read & execute (5) permissions.
9. How to change file ownership?
chown user:group filename
10. How to view disk usage?
df -h and du -sh
11. How to find a file?
find / -name filename
12. Difference between > and >>?
> overwrites, >> appends.
13. What is a symbolic link?
A shortcut pointing to another file. Created using ln -s.
14. What is hard link?
It points directly to the inode. Deleting original won’t remove it.
15. How to view file content?
cat, less, more, head, tail
USER & GROUP MANAGEMENT
16. How to add a new user?
useradd username
passwd username
17. How to delete a user?
userdel username
18. How to create a group?
groupadd groupname
19. How to add user to group?
usermod -aG groupname username
20. What are UID and GID?
UID is User ID, GID is Group ID. They identify users/groups.
21. How to switch user?
su - username
PROCESS MANAGEMENT
22. How to list processes?
ps aux or top
23. What is the difference between ps and top?
ps gives snapshot, top is real-time.
24. How to kill a process?
kill PID or kill -9 PID
25. How to find PID of a process?
pidof processname or ps aux | grep processname
26. What is a zombie process?
A process that has completed but still has an entry in the process table.
27. How to make a process run in background?
command &
28. How to bring background process to foreground?
fg
PACKAGE MANAGEMENT
29. Package manager in Ubuntu?
apt
30. Install a package using APT?
sudo apt install packagename
31. Remove a package?
sudo apt remove packagename
32. What is the equivalent in Red Hat-based systems?
yum or dnf
33. How to update all packages?
sudo apt update && sudo apt upgrade
SHELL & SCRIPTING
34. What is a shell?
A command-line interpreter that lets users interact with the OS.
35. Popular Linux shells?
bash, zsh, sh, ksh, csh
36. How to make a script executable?
chmod +x script.sh
37. How to run a script?
./script.sh
38. What is $? in shell?
Exit status of last command (0 = success).
39. How to debug a shell script?
bash -x script.sh
40. Difference between sh and bash?
bash is advanced and interactive, sh is simpler and portable.
NETWORKING COMMANDS
41. Check IP address?
ip a or ifconfig
42. Check connectivity to host?
ping hostname
43. Check open ports?
netstat -tuln or ss -tuln
44. How to SSH into a server?
ssh user@host
45. Check DNS resolution?
nslookup domain.com
46. How to transfer files securely?
scp file user@host:/path
47. Test network speed?
iperf3
CRON JOBS & SCHEDULING
48. What is a cron job?
Scheduled task that runs at specified time.
49. How to list user’s cron jobs?
crontab -l
50. How to edit cron jobs?
crontab -e
51. Example: Run script every day at 5AM
0 5 * * * /path/script.sh
52. Cron special strings?
@reboot, @daily, @hourly
SYSTEM MONITORING & LOGS
53. How to check system uptime?
uptime
54. How to check memory usage?
free -h
55. How to see CPU load?
top or uptime
56. View system logs?
journalctl or /var/log/syslog
57. Log for SSH?
/var/log/auth.log
PERMISSIONS & SECURITY
58. File permission types?
Read (r), Write (w), Execute (x)
59. What is umask?
Default permission mask applied to new files.
60. How to change directory permission?
chmod 755 dir
61. What is SUID/SGID?
SUID: Executes with owner's privilege.
SGID: Executes with group's privilege.
62. How to check active users?
who, w, users
BOOTING & RUNLEVELS
63. What is GRUB?
Bootloader that loads the OS.
64. How to reboot the system?
reboot or shutdown -r now
65. What is init and systemd?
init is the traditional init system. systemd is the modern replacement.
66. Check systemd services?
systemctl list-units --type=service
67. Start/stop a service?
systemctl start nginx
systemctl stop nginx
FILESYSTEM & STORAGE
68. Mount a device?
mount /dev/sdb1 /mnt
69. Unmount a device?
umount /mnt
70. Check partition info?
lsblk or fdisk -l
71. Format a disk to ext4?
mkfs.ext4 /dev/sdb1
72. What is fstab?
/etc/fstab contains disk mount info for boot.
73. How to create a swap file?
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
ADVANCED & TROUBLESHOOTING
74. How to check which ports are open?
ss -ltnp
75. Find which process is using a port?
lsof -i :8080
76. Check SELinux status?
sestatus
77. Disable SELinux temporarily?
setenforce 0
78. What is strace?
Tool to trace system calls of a process.
79. How to analyze memory leaks?
valgrind, top, htop
80. Kernel version?
uname -r
81. System architecture?
uname -m
LVM, RAID, BACKUP
82. What is LVM?
Logical Volume Manager for flexible disk management.
83. Basic LVM commands?
pvcreate, vgcreate, lvcreate
84. What is RAID?
Redundant Array of Independent Disks for data redundancy/performance.
85. Common RAID levels?
RAID 0 (stripe), RAID 1 (mirror), RAID 5 (parity)
86. How to create a tar archive?
tar -cvf archive.tar files/
87. Extract a tar file?
tar -xvf archive.tar
88. How to backup using rsync?
rsync -av source/ destination/
INTERVIEW CONCEPTUAL QUESTIONS
89. How does Linux handle memory management?
Through paging, swapping, and virtual memory techniques.
90. Explain fork() system call.
Used to create a child process.
91. What happens when you type a command in terminal?
Shell parses → Kernel executes → Output returned
92. What is difference between exec() and fork()?
fork() creates new process, exec() replaces current process.
93. How to secure Linux server?
SSH hardening, firewall, updates, user permissions, auditd.
94. How to troubleshoot high CPU usage?
top, htop, pidstat, strace, ps
95. How to monitor disk I/O?
iostat, iotop, dstat
96. Difference between soft and hard links?
Soft: path-based. Hard: inode-based.
97. What is /proc and /sys in Linux?
/proc and /sys are virtual filesystems exposing kernel info.
98. What are runlevels?
Defines system states. systemd replaces runlevels with targets.
99. Difference between cron and at?
cron is for recurring jobs, at is for one-time jobs.
100. What is load average?
Average number of processes waiting to be executed.