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

Popular posts from this blog

Linux interview Questions :

Linux interview questions