0% found this document useful (0 votes)
62 views2 pages

Essential Linux Command Cheat Sheet

This document is a comprehensive Linux command cheat sheet that covers various categories including network commands, file operations, system information, process management, user management, text processing, shortcuts, SSH/SCP, and package management using APT. Each category lists essential commands along with brief descriptions of their functions. It serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

sinaaraamjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views2 pages

Essential Linux Command Cheat Sheet

This document is a comprehensive Linux command cheat sheet that covers various categories including network commands, file operations, system information, process management, user management, text processing, shortcuts, SSH/SCP, and package management using APT. Each category lists essential commands along with brief descriptions of their functions. It serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

sinaaraamjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

=====================================================================

= LINUX COMMAND CHEAT SHEET =


=====================================================================

🔹 NETWORK COMMANDS
-------------------
ping [Link] # Test connectivity
ifconfig/ip a # Show network interfaces
traceroute [Link] # Trace network path
netstat -tulnp # Show active connections
ss -tulnp # Modern netstat alternative
arp -a # Show ARP table
dhclient -r; dhclient # Release/renew DHCP
nmcli device show # NetworkManager info
dig [Link] # DNS lookup
whois [Link] # Domain registration info

🔹 FILE OPERATIONS
------------------
ls -lah # List all files with details
cp -r dir1 dir2 # Copy directory recursively
mv [Link] [Link] # Rename file
rm -rf dir # Force remove directory
find / -name "*.log" # Find files by name
grep "text" file # Search text in file
chmod 755 [Link] # Change permissions
chown user:file # Change owner
stat [Link] # Show file details
tar -czvf [Link] dir # Create compressed archive

🔹 SYSTEM INFO
--------------
uname -a # Kernel/system info
df -h # Disk space
free -h # Memory usage
uptime # System uptime
lscpu # CPU info
lsblk # Block devices
dmesg | tail # Recent kernel messages
journalctl -xe # Systemd logs

🔹 PROCESS MANAGEMENT
---------------------
ps aux # List all processes
top/htop # Interactive process viewer
kill -9 PID # Force kill process
pkill -f "process" # Kill by process name
nice -n 10 command # Run with low priority
renice 15 -p PID # Change priority

🔹 USER MANAGEMENT
------------------
sudo command # Run as root
su - username # Switch user
passwd # Change password
useradd -m newuser # Add user
usermod -aG group user # Add to group
last # Show logins
🔹 TEXT PROCESSING
------------------
cat file | grep "text" # Filter output
head -n 5 file # Show first 5 lines
tail -f [Link] # Follow log file
sort [Link] # Sort lines
uniq [Link] # Remove duplicates
awk '{print $1}' file # Print first column
sed 's/old/new/g' file # Replace text
wc -l [Link] # Count lines

🔹 SHORTCUTS
------------
Ctrl+C # Kill current process
Ctrl+Z # Suspend process
bg # Run suspended in background
fg # Bring to foreground
Ctrl+D # EOF/Exit shell
!! # Repeat last command
!$ # Last argument of prev command
alias ll='ls -lah' # Create command alias

🔹 SSH/SCP
----------
ssh user@host # Connect to remote
scp file user@host:path # Copy to remote
rsync -avz dir/ user@host:dir/ # Sync directories

🔹 PACKAGE MANAGEMENT (APT)


---------------------------
apt update # Update package list
apt upgrade # Upgrade packages
apt install package # Install package
apt remove package # Remove package
apt search term # Search packages
dpkg -i [Link] # Install .deb file

You might also like