Ace Your Linux Interview!

Listen to this Post

Preparing for a Linux interview? Here’s a comprehensive list of 100+ Linux interview questions covering essential topics like commands, user management, security, and more. Whether you’re aiming for a DevOps, SysAdmin, or Software Engineering role, mastering these concepts will give you an edge.

You Should Know:

1. Basic Linux Commands


<h1>File & Directory Operations</h1>

ls -lha # List files with details 
mkdir -p dir1/dir2 # Create nested directories 
rm -rf dir/ # Force delete a directory 
find / -name "*.log" # Find files by name

<h1>Process Management</h1>

ps aux | grep nginx # Check running processes 
kill -9 PID # Force kill a process 
top # Monitor system processes

<h1>Networking</h1>

ifconfig # Network interface details 
netstat -tuln # List open ports 
ping google.com # Check connectivity 

#### **2. User & Permission Management**


<h1>User Operations</h1>

useradd -m john # Create a user with home dir 
passwd john # Set user password 
usermod -aG sudo john # Add user to sudo group

<h1>Permissions</h1>

chmod 755 script.sh # Set read/write/execute 
chown user:group file # Change ownership 

#### **3. Security & Hardening**


<h1>SSH Security</h1>

ssh-keygen -t rsa # Generate SSH keys 
nano ~/.ssh/config # Configure SSH client

<h1>Firewall (UFW)</h1>

ufw allow 22/tcp # Allow SSH 
ufw enable # Enable firewall

<h1>Log Monitoring</h1>

tail -f /var/log/auth.log # Monitor auth attempts 

#### **4. System & Performance**


<h1>Disk Usage</h1>

df -h # Check disk space 
du -sh /var/log # Directory size

<h1>Cron Jobs</h1>

crontab -e # Edit cron jobs 
*/5 * * * * /path/script.sh # Run every 5 mins 

#### **5. Shell Scripting**

#!/bin/bash

<h1>Backup script</h1>

tar -czvf backup.tar.gz /path/to/files 
scp backup.tar.gz user@remote:/backup/ 

### **What Undercode Say:**

Linux interviews test practical knowledge—focus on commands, scripting, and troubleshooting. Practice these:
grep, awk, sed for text processing.
systemctl for service management.
lsof to check open files.
rsync for efficient file transfers.
journalctl for system logs.

For advanced roles, study Kernel modules, SELinux, and Docker commands.

### **Expected Output:**


<h1>Example: Check active services</h1>

systemctl list-units --type=service --state=running

<h1>Example: Secure SSH (disable root login)</h1>

sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config 
sudo systemctl restart sshd 

Master these, and you’ll ace your Linux interview! 🚀

References:

Reported By: S Wakhare – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image