Essential Linux Commands Cheatsheet for System Management

Listen to this Post

Featured Image
Managing a Linux system efficiently requires mastering command-line tools. Below is a categorized list of essential Linux commands, along with practical examples and usage scenarios.

Package Management

– `apt-get` (Debian/Ubuntu):

sudo apt-get update  Update package list 
sudo apt-get install nginx  Install a package 
sudo apt-get remove nginx  Remove a package 

– `yum/dnf` (RHEL/CentOS/Fedora):

sudo yum install httpd  Install a package 
sudo dnf remove httpd  Remove a package 

– `dpkg` (Debian low-level tool):

sudo dpkg -i package.deb  Install a .deb file 
sudo dpkg -r package  Remove a package 

– `rpm` (Red Hat low-level tool):

sudo rpm -ivh package.rpm  Install an RPM 
sudo rpm -e package  Remove a package 

Networking Commands

– `ifconfig` (Legacy, use `ip` now):

ifconfig eth0 up  Enable network interface 
ifconfig eth0 down  Disable interface 

– `ping` (Check connectivity):

ping google.com  Continuous ping 
ping -c 4 google.com  Ping 4 times 

– `netstat` (Network stats):

netstat -tuln  List listening ports 
netstat -r  Display routing table 

– `iptables` (Firewall rules):

sudo iptables -L  List firewall rules 
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT  Allow SSH 

Process Management

– `ps` (Process snapshot):

ps aux  List all running processes 
ps -ef | grep nginx  Find a specific process 

– `top` (Real-time process monitor):

top  Interactive process viewer 

– `kill` (Terminate processes):

kill -9 PID  Force kill a process 
killall nginx  Kill all nginx processes 

System & Service Control

– `systemctl` (Systemd services):

sudo systemctl start nginx  Start a service 
sudo systemctl enable nginx  Enable on boot 
sudo systemctl status nginx  Check service status 

– `service` (Legacy service management):

sudo service apache2 restart  Restart a service 

– `chkconfig` (Legacy runlevel control):

sudo chkconfig httpd on  Enable service at boot 

File & Directory Operations

– `ls` (List files):

ls -la  Show all files (including hidden) 

– `chmod` (Change permissions):

chmod 755 script.sh  Give execute permissions 
chmod +x script.sh  Make file executable 

– `chown` (Change ownership):

sudo chown user:group file.txt  Change owner & group 

– `grep` (Search text):

grep "error" /var/log/syslog  Find errors in logs 

User & Group Management

– `useradd` (Create user):

sudo useradd -m newuser  Create user with home dir 

– `usermod` (Modify user):

sudo usermod -aG sudo newuser  Add user to sudo group 

– `passwd` (Change password):

sudo passwd newuser  Set user password 

Disk & Memory Management

– `df` (Disk space):

df -h  Human-readable disk usage 

– `free` (Memory usage):

free -m  Show memory in MB 

You Should Know:

– `awk` (Advanced text processing):

awk '{print $1}' file.txt  Print first column 

– `sed` (Stream editing):

sed 's/old/new/g' file.txt  Replace text globally 

– `cron` (Schedule tasks):

crontab -e  Edit cron jobs 

What Undercode Say:

Mastering these Linux commands enhances system administration efficiency. Automate tasks, debug issues, and secure systems using these essential tools.

Expected Output:

A structured, actionable Linux command cheatsheet with real-world usage examples.

Prediction:

As Linux remains dominant in servers and cloud environments, proficiency in CLI tools will continue to be a critical skill for IT professionals.

References:

Reported By: Parasmayur Linux – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram