Linux Interview Questions for experienced
Advanced Linux Interview Questions (with Practical Focus)
๐ง 1. What happens when you type a command in Linux?
Flow:
Shell receives command
Checks PATH variable
Finds binary (/bin, /usr/bin)
Forks process
Executes via exec()
⚙️ 2. How do you check CPU, Memory, and Disk usage?
top
htop
free -m
vmstat
iostat
df -h
du -sh *
๐ Real-time:
“If server is slow → first check top and iostat”
๐ 3. How do you find which process is using high CPU?
top
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head
Kill process:
kill -9
๐ 4. Difference between soft link and hard link?
Feature Soft Link Hard Link
Command ln -s ln
Inode Different Same
Works across FS Yes No
If original deleted Broken Still works
๐ 5. File permissions (very important)
chmod 755 file
chown user:group file
๐ 755 = rwxr-xr-x
๐ฅ 6. What is inode?
Stores metadata of file (size, owner, permissions)
Does NOT store filename
Check:
ls -i
df -i
๐งช 7. What will you do if disk is full?
df -h
du -sh /*
find / -size +100M
๐ Clear logs:
truncate -s 0 /var/log/messages
๐ 8. How do you check open ports?
netstat -tulnp
ss -tulnp
๐ 9. What is cron job?
crontab -e
Example:
0 2 * * * /backup.sh
๐จ 10. Server is not reachable. What will you check?
Step-by-step:
ping
telnet
systemctl status sshd
netstat -tulnp
๐งฉ 11. What is load average?
uptime
๐ Example: 1.00 0.80 0.60
1 min, 5 min, 15 min load
๐ง 12. What is systemctl?
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl status nginx
systemctl enable nginx
๐ 13. How to check logs?
tail -f /var/log/messages
journalctl -xe
๐ง 14. Zombie process – what is it?
Process completed but still in process table
Parent didn't read exit status
Check:
ps aux | grep Z
๐ 15. Difference: kill, kill -9, pkill, killall
kill → graceful
kill -9 → force
pkill → by name
killall → all processes
๐งช 16. How do you monitor real-time logs?
tail -f /var/log/syslog
๐ฆ 17. Package management (RHEL / Ubuntu)
yum install nginx
dnf install nginx
apt install nginx
๐งต 18. What is a process vs thread?
Process → independent
Thread → lightweight inside process
๐ 19. What is sudo?
Run command as root
sudo su -
๐งฐ 20. Troubleshooting scenario (VERY IMPORTANT)
๐ Scenario: Application is down
Steps:
Check service
systemctl status app
Check logs
journalctl -xe
Check port
netstat -tulnp
Check disk
df -h
Check CPU
top
๐ฅ Bonus: Real-Time Interview Questions
๐ Q: How do you find large files?
find / -type f -size +1G
๐ Q: How to check last reboot?
who -b
uptime
๐ Q: How to check user login history?
last
๐ Q: How to change hostname?
hostnamectl set-hostname newname
Comments
Post a Comment