Categories: Cheat Sheet

๐Ÿงพ Basic Linux Command Cheat Sheet for Beginners

Whether youโ€™re a new Linux user or a beginner sysadmin, mastering the terminal is a must. This cheat sheet provides essential Linux commands for daily use โ€” covering navigation, file manipulation, user management, permissions, networking, and more.

Save this post or bookmark it for quick reference!


๐Ÿ“ File and Directory Commands

ls        # List directory contents
cd        # Change directory
pwd       # Show current directory path
mkdir     # Create a new directory
rmdir     # Remove an empty directory
touch     # Create an empty file
cp        # Copy files/directories
mv        # Move or rename files/directories
rm        # Delete files/directories
tree      # Show directory structure (may need to install)

๐Ÿ“ Viewing and Editing Files

cat       # View file content
less      # View file one page at a time
head      # Show first 10 lines
tail      # Show last 10 lines
nano      # Terminal text editor
vim       # Advanced text editor

๐Ÿ” File Permissions and Ownership

chmod     # Change file permissions
chown     # Change file ownership
umask     # Show default permission mask
ls -l     # Long listing with permissions

Example:

chmod +x script.sh     # Make a script executable
chown user:user file   # Set owner and group

๐Ÿ‘ฅ User Management

whoami     # Show current user
id         # Show user/group IDs
adduser    # Create a new user
passwd     # Change user password
su         # Switch user
sudo       # Run as root

๐Ÿ“ฆ Package Management

For Debian/Ubuntu:

sudo apt update
sudo apt install packagename
sudo apt remove packagename
sudo apt upgrade

For RHEL/CentOS:

sudo dnf install packagename
sudo yum install packagename

๐ŸŒ Networking Commands

ip a            # Show IP addresses
ping example.com  # Test connectivity
traceroute google.com  # Show route to host
netstat -tuln   # Show listening ports (use ss instead)
ss -tuln        # Modern netstat replacement
curl example.com # HTTP requests
wget URL        # Download file

๐Ÿ“Š System Monitoring

top         # Real-time process view
htop        # Enhanced top (install with apt/dnf)
free -h     # Show memory usage
df -h       # Disk space usage
du -sh *    # Folder sizes
uptime      # System load
uname -a    # Kernel info

๐Ÿ›  Useful Shortcuts

  • Ctrl + C โ†’ Stop command
  • Ctrl + D โ†’ Logout or end input
  • Tab โ†’ Auto-complete
  • !! โ†’ Run last command
  • history โ†’ View command history
  • clear โ†’ Clear terminal

๐Ÿง  Final Thoughts

This cheat sheet only scratches the surface of whatโ€™s possible with Linux. As you get more comfortable, try exploring shell scripting, cron jobs, and advanced tools like awk, sed, or tmux.

Donโ€™t be afraid to explore, break, and learn โ€” thatโ€™s the Linux way.


๐Ÿ”— Useful Links

ferisetyawanmyid

๐Ÿš€ Certified Linux System Administrator | DevOps | Server Optimization | Cybersecurity | DRC Solutions

Recent Posts

How to Install CyberPanel on Ubuntu 24.04 LTS (Step-by-Step Guide)

CyberPanel is a modern web hosting control panel powered by OpenLiteSpeed, designed for high performance,…

7 days ago

Welcome to My Personal Blog

๐Ÿš€ Certified Linux System Administrator | DevOps | Server Optimization | Cybersecurity | DRC Solutions…

2 weeks ago

10 Essential Linux Commands Every SysAdmin Should Know

As a Linux System Administrator, mastering the command line is key to efficiently managing servers,…

2 months ago

๐Ÿš€ How to Install WireGuard with Docker on Ubuntu 24.04 (wg-easy Dashboard)

Introduction WireGuard is a fast, lightweight, and modern VPN protocol designed for simplicity and performance.If…

3 months ago

How To Install Certbot on Ubuntu 24.04: Set Up Letโ€™s Encrypt for Apache and Nginx

Securing your website with HTTPS is essential for privacy, SEO ranking, and user trust. Letโ€™s…

3 months ago

Best SSH Clients for Linux: Top Tools for Secure Remote Connections

If you manage Linux servers regularly, you know how important SSH (Secure Shell) is. Whether…

3 months ago

This website uses cookies.