Linux Interview Questions and Answe
Linux Interview Questions and Answe
3. What are inodes in Linux?An inode is a data structure used to store information
about a file, such as its size, owner, permissions, and location on disk—but not
its name.
5. How do you check disk usage in Linux?Use df -h to check disk space and du -sh to
check the size of a specific directory.
6. What is the difference between absolute and relative path?An absolute path
starts from the root (/), while a relative path is relative to the current working
directory.
9. How do you find a file in Linux?Use find /path -name filename or locate filename
(after running updatedb).
10. How do you check running processes?Use ps aux, top, or htop (if installed).
11. How do you kill a process in Linux?Use kill PID, kill -9 PID for force kill, or
pkill process_name.
14. How do file permissions work in Linux?Permissions are in rwx format: read,
write, execute. They can be set using symbolic or octal format (e.g., chmod 755
file).
15. What’s the difference between soft link and hard link?
16. How do you check network connectivity?Use ping, netstat, ss, ifconfig, or ip a.
17. How to open a specific port in Linux?Use iptables, ufw, or firewalld to allow
traffic on the port. Example: sudo ufw allow 8080.
19. What’s the difference between bash and sh?bash is an enhanced version of sh
with more features like command history, arrays, and scripting options.
20. What are some basic shell commands you use daily?cd, ls, cp, mv, rm, cat, grep,
echo, pwd, man
#!/bin/bash
echo "Hello, World!"
dob : 12-11-2005
pin : 841301
roll no : 2304023
Papa ji ka 8051925289
address : husse chapara bihar saran
Father's name - vishwakarma prasad
Mother- sunita devi
Save as script.sh, then run with chmod +x script.sh and ./script.sh
22. What is a cron job and how do you schedule one?A cron job is used to schedule
tasks. Edit with crontab -e. Example to run a script daily:
0 0 * * * /path/to/script.sh
23. How do you monitor system performance (CPU, RAM)?Use top, htop, vmstat, free -
h, or iostat.