menu_bookSYSTEM_DOCUMENTATION (DOCS & CHEATSHEETS)
docs search ~
Matching RecordsCount: 3
LINUX_COMMANDSLast Updated: 2026-07-11
Linux Commands Cheat Sheet
"Essential commands used for checking server resource utilization, process debugging, networking audits, and service logs."
//1. Navigation & File Management
bash
pwd # Show current working directory.
ls # List files and directories.
ls -la # Show all files with permissions and hidden files.
cd # Change directory.
tree # Display directory structure as a tree.
mkdir # Create a directory.
mkdir -p # Create nested directories.
rmdir # Remove an empty directory.
rm # Delete files.
rm -r # Delete directories recursively.
rm -rf # Force delete files/directories.
cp # Copy files/directories.
cp -r # Copy directories recursively.
mv # Move or rename files.
touch # Create an empty file.
stat # Show file metadata.
file # Identify file type.
basename # Get filename only.
dirname # Get directory path only.
find # Search for files/directories.
locate # Quickly search indexed files.
which # Find executable location.
whereis # Locate binary, source, and man pages.
realpath # Show absolute path.
//2. Viewing File Contents
bash
cat # Display file contents.
less # View large files interactively.
more # View files page by page.
head # Show first lines of a file.
tail # Show last lines of a file.
tail -f # Monitor log files in real time.
nl # Display file with line numbers.
wc # Count lines, words, and characters.
strings # Extract readable text from binaries.
//3. Editing Files
bash
nano # Beginner-friendly terminal editor.
vim # Powerful text editor for servers.
vi # Standard Unix editor.
sed # Stream editor for replacing/editing text.
awk # Pattern scanning and data processing.
//4. Permissions & Ownership
bash
chmod # Change file permissions.
chown # Change file owner.
chgrp # Change file group.
umask # Set default permissions for new files.
id # Show user and group IDs.
groups # Show user's groups.
whoami # Display current username.
//5. User Management
bash
useradd # Create a user.
adduser # Interactive user creation.
usermod # Modify a user account.
userdel # Delete a user.
passwd # Change a user's password.
su # Switch user.
sudo # Execute commands as another user (typically root).
//6. Process Management
bash
ps # List running processes.
ps aux # Show all running processes.
top # Live process monitor.
htop # Interactive process viewer.
kill # Terminate a process by PID.
killall # Kill processes by name.
pkill # Kill processes matching a pattern.
nice # Start a process with custom priority.
renice # Change priority of a running process.
jobs # Show background jobs.
bg # Resume a job in the background.
fg # Bring a job to the foreground.
nohup # Run a process after logout.
//7. Disk Management
bash
df -h # Show disk usage.
du -sh # Show directory size.
du -ah # Show size of all files.
lsblk # List block devices.
blkid # Show filesystem UUIDs.
fdisk # Manage disk partitions.
parted # Advanced partition manager.
mount # Mount a filesystem.
umount # Unmount a filesystem.
sync # Flush filesystem buffers to disk.
//8. Memory & CPU
bash
free -h # Display memory usage.
vmstat # Show memory and CPU statistics.
iostat # Monitor CPU and disk I/O.
sar # Collect and report system statistics.
uptime # Show system uptime and load.
lscpu # Display CPU information.
nproc # Show number of CPU cores.
//9. Networking
bash
ip addr # Show IP addresses.
ip route # Display routing table.
ping # Test network connectivity.
traceroute # Trace network path.
tracepath # Trace packets without root.
ss # Display network sockets.
netstat # Show network connections (legacy).
curl # Send HTTP requests.
wget # Download files from the web.
dig # Query DNS records.
nslookup # DNS lookup utility.
host # Resolve hostnames.
arp # Show ARP table.
hostname # Display system hostname.
hostnamectl # Manage hostname.
nc (netcat) # Test TCP/UDP connections.
telnet # Test remote ports.
scp # Securely copy files over SSH.
rsync # Efficient file synchronization.
ssh # Secure remote login.
ssh-keygen # Generate SSH keys.
ssh-copy-id # Copy SSH keys to a remote host.
//10. Compression
bash
tar # Archive files.
gzip # Compress files.
gunzip # Decompress gzip files.
zip # Create ZIP archives.
unzip # Extract ZIP archives.
xz # High-ratio compression.
bzip2 # Compress using BZip2.
//11. Logs & Monitoring
bash
journalctl # View systemd logs.
dmesg # Show kernel messages.
logger # Write messages to system logs.
tail -f /var/log/... # Follow logs in real time.
//12. Services (systemd)
bash
systemctl status # Check service status.
systemctl start # Start a service.
systemctl stop # Stop a service.
systemctl restart # Restart a service.
systemctl reload # Reload service configuration.
systemctl enable # Enable service at boot.
systemctl disable # Disable startup.
systemctl daemon-reload # Reload systemd units.
//13. Package Management
Ubuntu/Debian
bash
apt update # Update package lists.
apt upgrade # Upgrade installed packages.
apt install # Install packages.
apt remove # Remove packages.
apt purge # Remove package and config.
apt autoremove # Remove unused packages.
RHEL/CentOS
bash
yum install # Install packages.
dnf install # Install packages (newer systems).
rpm -qa # List installed RPM packages.
//14. Search & Text Processing
bash
grep # Search for text patterns.
grep -r # Recursive text search.
sort # Sort lines.
uniq # Remove duplicate lines.
cut # Extract fields.
paste # Merge files line-wise.
tr # Translate/delete characters.
xargs # Build commands from input.
tee # Write output to file and screen.
diff # Compare files.
cmp # Compare files byte by byte.
//15. Environment Variables
bash
env # Show environment variables.
printenv # Print environment variables.
export # Set environment variables.
unset # Remove environment variables.
source # Reload shell configuration.
//16. Scheduling
bash
crontab -e # Edit cron jobs.
crontab -l # List cron jobs.
at # Schedule a one-time task.
//17. Archives & Backups
bash
rsync # Incremental backup and synchronization.
dd # Copy disks and create disk images.
mkfs # Create a filesystem.
fsck # Check and repair filesystems.
//18. Security
bash
sudo # Execute commands with elevated privileges.
visudo # Safely edit the sudoers file.
ufw # Manage firewall (Ubuntu).
iptables # Configure Linux firewall rules.
firewall-cmd # Manage Firewalld.
fail2ban-client # Manage Fail2Ban.
//19. Cloud & Server Troubleshooting
bash
history # Show command history.
alias # Create command shortcuts.
unalias # Remove aliases.
time # Measure command execution time.
watch # Repeatedly execute a command.
lsof # List open files and ports.
strace # Trace system calls of a process.
tcpdump # Capture network packets.
screen # Persistent terminal sessions.
tmux # Terminal multiplexer for multiple sessions.
//20. Must-Know Cloud Engineer Commands
These are the commands you'll use almost every day in cloud engineering:
bash
ssh # Connect securely to remote Linux servers.
scp # Copy files securely between machines.
rsync # Synchronize files and backups efficiently.
journalctl # View and troubleshoot service logs.
systemctl # Manage system services.
tail -f # Monitor logs in real time.
curl # Test APIs and web endpoints.
wget # Download files and packages.
ip addr # Check IP configuration.
ss -tulnp # View listening ports and associated processes.
lsof -i # Identify which process is using a port.
df -h # Check available disk space.
du -sh # Find large directories consuming storage.
free -h # Monitor memory usage.
top / htop # Monitor CPU and processes.
ps aux # Inspect running processes.
chmod / chown # Manage file permissions and ownership.
find # Locate files and directories.
grep # Search logs and configuration files.
vim / nano # Edit configuration files.
crontab -e # Schedule recurring tasks.
tar # Archive and extract files.
dig / nslookup # Troubleshoot DNS issues.
ping / traceroute # Diagnose network connectivity.
mount / umount # Manage filesystems and attached storage.
history # Review previously executed commands.
Author: Saloni BhattadID: #1