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

Recent Posts

Free Website Hosting Control Panel for Linux

If you run a VPS or dedicated server with Linux, you probably know that managing…

1 week ago

How to Find Out Who Rebooted Your Ubuntu Server (Step-by-Step Guide)

Short summary: Use built-in Linux tools (`who`, `last`, `journalctl`, `/var/log/auth.log`) and optional audit logs to…

2 weeks ago

Best Free CMS Platforms for Self-Hosted Blogs and Websites [2025 Edition]

Choosing the right Content Management System (CMS) is key when you're building a blog, portfolio,…

3 weeks ago

🛡️ Protect Your Ubuntu Server with Fail2Ban: Step-by-Step Guide

Securing your Linux server is a critical task for every sysadmin. One of the simplest…

3 weeks ago

📡 Getting Started with tcpdump: A Beginner’s Guide for Linux Sysadmins

As a Linux system administrator, understanding what happens on your network is crucial. One of…

1 month ago

MegaCLI Cheat Sheet

MegaCLI: useful commands Here are some useful commands: View information about the RAID adapter For…

4 months ago

This website uses cookies.