1. How do you check system performance?
Use multiple tools depending on need:
top
htop
uptime
vmstat 1
iostat -x 1
free -m
sar -u 1 5
👉 Real-time: CPU bottleneck → check top & vmstat
2. How do you find high CPU consuming process?
top
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head
Kill process:
kill -9
3. How do you check memory usage?
free -m
cat /proc/meminfo
top
4. Difference between soft link & hard link?
ln file1 hardlink
ln -s file1 softlink
Hard link → same inode
Soft link → pointer (like shortcut)
5. How do you find large files?
find / -type f -size +100M
du -ah / | sort -rh | head -20
6. How do you monitor logs in real-time?
tail -f /var/log/messages
tail -f /var/log/syslog
7. What is inode?
Check inode:
ls -i
df -i
👉 Stores metadata of file
8. How do you manage disk space?
df -h
du -sh *
Clean:
rm -rf unwanted_files
9. How do you check open ports?
netstat -tulnp
ss -tulnp
10. How do you check running services?
systemctl status nginx
systemctl list-units --type=service
11. How do you restart a service?
systemctl restart nginx
12. What is cron job? How to schedule?
crontab -e
Example:
0 2 * * * /backup.sh
13. How do you find file by name?
find / -name file.txt
locate file.txt
14. How do you check disk I/O?
iostat -x 1
iotop
15. What is load average?
uptime
👉 Load > CPU cores → system overloaded
16. How do you change permissions?
chmod 755 file
chmod +x script.sh
17. How do you change ownership?
chown user:group file
18. How do you troubleshoot server down issue?
Step-by-step:
Check server access:
ping
ssh user@ip
Check CPU/memory:
top
free -m
Check disk:
df -h
Check logs:
tail -f /var/log/messages
19. How do you check network connectivity?
ping google.com
traceroute google.com
curl -I http://example.com
20. What is grep? Give example
grep "error" file.log
grep -i "failed" file.log
grep -r "password" /etc
21. How do you compress files?
tar -cvf file.tar dir/
tar -xvf file.tar
gzip file
gunzip file.gz
22. What is process management?
ps -ef
kill
nice
renice
23. What is swap memory?
Check:
swapon -s
free -m
24. Difference between TCP & UDP?
TCP → reliable
UDP → fast but no guarantee
25. How do you check OS version?
cat /etc/os-release
uname -a
💥 Real-Time Scenario Questions
🔹 Scenario 1: Disk full
df -h
du -sh *
find / -size +500M
🔹 Scenario 2: Server slow
top
vmstat
iostat
🔹 Scenario 3: Service not starting
systemctl status nginx
journalctl -xe
🔹 Scenario 4: Port not accessible
netstat -tulnp
ss -tulnp
firewall-cmd --list-all
⚡
Linux interview Questions :
1).How to recover accidently deleted /etc/fstab into linux os ? anyone deleted this /etc/fstab .after this we can' boot ur os. boot into recovery mode . then go to the linux terminal page . here we have to execute the blkid command here it will list out the avilble partions and attached filesystems . if your deleting the /etc/fatab.that time root parttion won't be work now we can mount the root parttion in rw mode mount -t ext4 -0 rw,remount dev/sda1 / 2).VMSTAT command into linux ? 3).iostat and dstat command into linux os ? 4).LInux free command into linux os ? in this way we can check it our the memeory usage and swap memeory as well. then it will display out the , used,space avilble ,total ,buffer/catche abd shared what is free space we can execute the command like as the, free -b command : we will get the particular output for the bits so if you want to getto int the outpit in kilobytes : so we can execut ethe comamnd like as the, free -k free -g: it will sh...
Comments
Post a Comment