Useful Linux Interview Questions

Listen to this Post

Linux is a critical skill for system administrators, DevOps engineers, and cybersecurity professionals. Below are some essential Linux interview questions along with practical commands and scenarios to help you prepare.

Basic Linux Commands You Should Know:

1. Check System Information

uname -a 
cat /etc/os-release 

– Displays kernel version and OS details.

2. List Files with Detailed Info

ls -la 

– Shows hidden files, permissions, and ownership.

3. Find Files by Name

find / -name "filename" 

– Searches the entire filesystem for a file.

4. Check Disk Usage

df -h 
du -sh * 

– `df` shows disk space, `du` checks directory sizes.

5. View Running Processes

top 
ps aux | grep "process_name" 

– Monitors system processes in real-time.

6. Network Configuration

ifconfig 
ip a 
netstat -tuln 

– Checks IP, network interfaces, and listening ports.

7. File Permissions

chmod 755 file.sh 
chown user:group file.txt 

– Modifies file access and ownership.

8. Compress and Extract Files

tar -czvf archive.tar.gz /folder 
tar -xzvf archive.tar.gz 

– Creates and extracts `.tar.gz` files.

9. Search Inside Files

grep "pattern" file.txt 
grep -r "error" /var/log 

– Finds text patterns in files.

10. Schedule Tasks with Cron

crontab -e 
*/5 * * * * /path/to/script.sh 

– Sets up automated script execution.

Advanced Linux Questions: