Listen to this Post
Preparing for a Linux interview requires a deep understanding of various system administration and security concepts. Below is a categorized list of essential Linux interview topics along with practical commands and examples to help you master them.
1️⃣ Filesystem Basics
- Key Commands:
– `ls` – List directory contents
– `cd` – Change directory
– `pwd` – Print working directory
– `mkdir` – Create a directory
– `rm` – Remove files/directories
– `cp` – Copy files
– `mv` – Move/rename files
Example:
ls -la /var/log # List all files (including hidden) in /var/log with details
### **2️⃣ File Permissions and Ownership**
- Key Commands:
– `chmod` – Change file permissions
– `chown` – Change file ownership
– `chgrp` – Change group ownership
– `umask` – Set default permissions
**Example:**
chmod 755 script.sh # Give owner rwx, group/others rx permissions chown root:admin file.txt # Change owner to root and group to admin
### **3️⃣ Process Management**
- Key Commands:
– `ps` – List processes
– `top` / `htop` – Interactive process viewer
– `kill` – Terminate a process
– `nice` / `renice` – Adjust process priority
**Example:**
ps aux | grep nginx # Find all Nginx processes kill -9 1234 # Forcefully kill process with PID 1234
### **4️⃣ Networking**
- Key Commands:
– `ifconfig` / `ip` – Network interface configuration
– `netstat` – Network statistics
– `ss` – Socket statistics
– `ping` – Test network connectivity
– `traceroute` – Trace network path
**Example:**
ip addr show # Display all network interfaces and IPs netstat -tuln # List listening TCP/UDP ports
### **5️⃣ User Management**
- Key Commands:
– `useradd` / `usermod` / `userdel` – Manage users
– `passwd` – Change password
– `groupadd` / `groupdel` – Manage groups
**Example:**
useradd -m -s /bin/bash newuser # Create a new user with home dir passwd newuser # Set password for the user
### **6️⃣ Package Management**
- Key Commands (Debian/Ubuntu):
– `apt update` – Update package list
– `apt install` – Install a package
– `apt remove` – Remove a package
**Example:**
apt install nginx -y # Install Nginx without confirmation
### **7️⃣ System Monitoring and Performance**
- Key Commands:
– `df` – Disk space usage
– `free` – Memory usage
– `vmstat` – System performance metrics
– `iostat` – Disk I/O statistics
**Example:**
free -h # Show memory usage in human-readable format df -h # Check disk space usage
### **8️⃣ Advanced Networking**
- Key Commands:
– `iptables` / `ufw` – Firewall management
– `tcpdump` – Packet sniffing
– `nmap` – Network scanning
**Example:**
ufw allow 22/tcp # Allow SSH traffic nmap -sV 192.168.1.1 # Scan a host for open ports and services
### **9️⃣ Scripting and Automation**
- Key Commands:
– `bash` scripting
– `cron` – Schedule tasks
– `systemd` – Service management
**Example:**
#!/bin/bash echo "Backup started at $(date)" >> /var/log/backup.log
### **🔟 Security and Permissions**
- Key Commands:
– `sudo` – Execute commands as superuser
– `su` – Switch user
– `find` – Search for files with specific permissions
**Example:**
find / -perm -4000 2>/dev/null # Find all SUID files
### **What Undercode Say**
Mastering Linux commands and concepts is crucial for system administrators, cybersecurity professionals, and DevOps engineers. Regular practice with real-world scenarios will solidify your understanding.
### **Expected Output:**
A well-structured Linux interview preparation guide with categorized topics, practical commands, and examples.
**Related URLs:**
References:
Reported By: Murad Hossain – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅



