LINUX CHEAT SHEET SERIES — PART 1 OF 10
Linux Commands for Beginners: The Ultimate Quick Reference Guide
Every Linux expert started exactly where you are right now — staring at a blinking cursor, wondering what to type next. In this first part of our 10-part Linux Cheat Sheet series, we’re building your foundation: the core commands you’ll use every single day when working with a Linux server, whether it’s a Linux VPS, a dedicated server, or your own home lab.
💡 New to this series? We’re turning a popular 10-part Linux cheat sheet into a full beginner course — one topic per article, with plain-English explanations and real examples you can copy-paste. No prior Linux experience needed. Bookmark this page and follow along!
📋 What You’ll Learn
1. What Is the Linux Terminal (and Why Should You Care)?
The terminal — also called the shell, console, or command line — is a text-based way to talk directly to your computer’s operating system. Instead of clicking icons, you type instructions (commands) and the system executes them instantly.
On a server, there usually isn’t a graphical desktop at all — the terminal is the interface. That’s why learning these commands isn’t optional if you’re managing a VPS, RDP, or dedicated server: it’s the fastest, most reliable, and often the only way to get things done.
Once you connect to your server (typically via SSH), you’ll see a prompt that looks something like this:
user@server:~$
Everything after that dollar sign ($)
is where you type your command. Press Enter to run it. That’s it — that’s the whole loop:
type a command, press Enter, read the output, repeat.
2. File & Directory Basics
In Linux, everything is organized into files and directories (what Windows calls “folders”). These are the first commands every beginner needs, because you’ll use them dozens of times per session just to move around and see what’s there.
📂 Navigating the Filesystem
| Command | What It Does |
|---|---|
pwd | Print Working Directory — shows where you currently are |
ls | Lists files and folders in the current directory |
ls -l | Long listing format — shows permissions, owner, size, date |
ls -a | Shows hidden files too (names starting with a dot) |
ls -lh | Long format with human-readable sizes (KB, MB, GB) |
cd <dir> | Change directory — moves you into a folder |
cd .. | Go up one directory level |
cd ~ | Jump straight to your home directory |
cd - | Go back to the previous directory you were in |
Try it yourself:
$ pwd
/home/user
$ ls -lh
drwxr-xr-x 2 user user 4.0K Jul 20 10:15 backups
-rw-r--r-- 1 user user 312 Jul 22 09:03 notes.txt
$ cd backups
$ pwd
/home/user/backups
$ cd ..
$ pwd
/home/user
⭐ Beginner Tip: Press the Tab key while typing a file or folder name — Linux will auto-complete it for you. This saves time and avoids typos, which matter a lot on servers.
📁 Creating & Removing Directories
| Command | What It Does |
|---|---|
mkdir <dir> | Creates a new directory |
rmdir <dir> | Removes an empty directory |
Example — setting up a project folder:
$ mkdir my-website
$ cd my-website
$ mkdir images css js
$ ls
css images js
Note that rmdir only works on empty folders — if a directory has files inside,
you’ll need rm -r <dir> (covered in the Permissions article later in this series,
since deleting files is powerful and needs to be handled carefully).
3. Viewing & Editing Files
You’ll spend a huge amount of time reading configuration files, log files, and code on a server. These commands let you look inside files without needing a graphical text editor.
👀 Reading File Contents
| Command | What It Does |
|---|---|
cat <file> | Prints the entire file to the screen at once |
less <file> | Opens the file page-by-page (best for large files) |
more <file> | Similar to less, older/simpler scrolling viewer |
head <file> | Shows the first 10 lines of a file |
head -n 20 <file> | Shows the first 20 lines |
tail <file> | Shows the last 10 lines of a file |
tail -f <file> | “Follows” a file live — new lines appear as they’re written |
wc -l <file> | Counts the number of lines in a file |
🔥 Real-world use case: Something on your website just broke. Instead of guessing, you’d run:
$ tail -f /var/log/syslog
This shows you errors as they happen, in real time — one of the most useful debugging tricks you’ll learn as a sysadmin.
✏️ Editing Files
| Command | What It Does |
|---|---|
nano <file> | Opens a beginner-friendly text editor (recommended to start) |
vim <file> | Opens the powerful (but harder to learn) Vim editor |
For beginners, start with nano. It shows the available keyboard shortcuts
right at the bottom of the screen (like Ctrl+O to save and Ctrl+X to exit), so
you don’t need to memorize anything up front. Vim is more powerful once you’re comfortable, but it has
a steeper learning curve — we’ll cover it properly in a later part of this series.
🔍 Searching & Sorting
| Command | What It Does |
|---|---|
grep "text" <file> | Searches for a word or phrase inside a file |
grep -r "text" . | Searches recursively through every file in a folder |
sort <file> | Sorts the lines of a file alphabetically |
uniq <file> | Removes duplicate adjacent lines |
cut -d, -f1 <file> | Extracts the 1st column from a comma-separated (CSV) file |
paste f1 f2 | Merges two files side by side, column by column |
Example — finding every “error” mention in a log file:
$ grep -i "error" /var/log/syslog
Jul 29 10:02:14 server kernel: error: disk read failure
Jul 29 10:15:41 server app: error connecting to database
The -i flag makes the search case-insensitive, so it catches “Error”, “ERROR”, and “error” all at once.
4. Process & System Commands
A “process” is simply a running program. Your web server, database, and even the shell itself are all processes. Knowing how to see what’s running — and stop it if needed — is essential server admin skill.
| Command | What It Does |
|---|---|
ps aux | Lists all running processes, in detail |
top | Live, real-time view of CPU/memory usage per process |
htop | A friendlier, color-coded version of top (install separately) |
kill <PID> | Politely asks a process to stop, using its Process ID |
kill -9 <PID> | Force-kills a process immediately (last resort) |
df -h | Shows disk space usage in human-readable form |
free -h | Shows how much RAM is used vs. free |
uname -a | Displays system/kernel information |
uptime | Shows how long the server has been running |
whoami | Tells you which user you’re currently logged in as |
Example — a website is running slow, so you check what’s eating resources:
$ top
PID USER %CPU %MEM COMMAND
4821 mysql 86.3 12.1 mysqld
2210 www 4.2 1.8 apache2
Here, mysqld (the MySQL database) is using 86% CPU — that’s your culprit. From here you
could investigate slow queries, or if it’s completely frozen, stop it safely with
kill <PID> and restart the service properly.
⚠️ Be careful with kill -9. It force-terminates a
process with no cleanup, which can corrupt open files or database transactions. Always try a normal
kill first, and only use -9 when a process is truly unresponsive.
5. Permissions, Users & Groups
Linux is a multi-user system at its core, so every file has an owner, a group, and a set of permissions controlling who can read, write, or execute it. (We’ll dedicate an entire, deep-dive article to this topic later in the series — Part 8 — but here’s the essential starting point.)
| Command | What It Does |
|---|---|
chmod <mode> <file> | Changes file permissions |
chmod 755 <file> | Owner: read/write/execute, everyone else: read/execute |
chmod 644 <file> | Owner: read/write, everyone else: read-only |
chown <user> <file> | Changes who owns a file |
useradd <user> | Creates a new user account |
passwd <user> | Sets or changes a user’s password |
id <user> | Shows a user’s ID and group memberships |
Understanding the permission numbers:
Each permission type has a number: read = 4, write = 2, execute = 1. Add them together for each of the three groups — owner, group, others:
chmod 755 script.sh
↓ ↓ ↓
owner group others
7 = 5 = 5
rwx r-x r-x
7 = 4(read) + 2(write) + 1(execute)
5 = 4(read) + 0 + 1(execute)
So 755 is a very common permission set for scripts and websites: the owner can do
everything, and everyone else can only read and run it (not modify it).
6. Archives & Compression
Whether you’re backing up a website or downloading software, you’ll constantly work with compressed archives. Here are the core tools:
| Command | What It Does |
|---|---|
tar -cvf file.tar <files> | Bundles files into a single .tar archive |
tar -xvf file.tar | Extracts a .tar archive |
tar -czvf file.tar.gz <files> | Creates a compressed .tar.gz archive |
tar -xzvf file.tar.gz | Extracts a .tar.gz archive |
gzip <file> | Compresses a single file into .gz |
zip -r archive.zip <dir> | Creates a .zip archive from a directory |
unzip archive.zip | Extracts a .zip archive |
Example — backing up your website’s files before making changes:
$ tar -czvf website-backup-2026-07-29.tar.gz /var/www/html/
$ ls -lh website-backup-2026-07-29.tar.gz
-rw-r--r-- 1 user user 42M Jul 29 20:14 website-backup-2026-07-29.tar.gz
A single command, and your entire site is safely bundled and compressed into one portable file. We’ll
cover tar and compression tools in much greater depth — including bzip2, xz, and password
protection — in Part 5 of this series.
7. Networking & Connectivity
| Command | What It Does |
|---|---|
ip a | Shows all IP addresses assigned to the server |
ping <host> | Tests whether a server/website is reachable |
traceroute <host> | Shows the network path/hops to reach a destination |
curl <url> | Fetches data from a URL (great for testing APIs/websites) |
wget <url> | Downloads a file from a URL |
ss -tulnp | Lists which ports are open and listening |
ssh user@host | Securely logs in to a remote server |
scp file user@host:/path | Securely copies a file to a remote server |
Example — checking if your VPS can reach the internet:
$ ping -c 4 google.com
64 bytes from google.com: icmp_seq=1 ttl=115 time=12.4 ms
64 bytes from google.com: icmp_seq=2 ttl=115 time=11.9 ms
64 bytes from google.com: icmp_seq=3 ttl=115 time=12.1 ms
64 bytes from google.com: icmp_seq=4 ttl=115 time=12.7 ms
The -c 4 flag limits the ping to 4 attempts instead of running forever — a small but handy habit to build early.
8. Miscellaneous Utilities
| Command | What It Does |
|---|---|
echo "text" | Prints text to the screen |
alias ll='ls -l' | Creates a shortcut/alias for a longer command |
which <command> | Shows the full path of a command |
man <command> | Opens the full manual page for any command |
history | Shows previously run commands |
env | Shows environment variables |
man is the single most important command on this list, because it means you never have
to memorize everything — you can always ask Linux to explain itself:
$ man tar
9. Tips & Good Practices
- ✅ Use Tab for auto-completion — it’s faster and prevents typos.
- ✅ Use the ↑ / ↓ arrow keys to reuse previous commands from history.
- ✅ Run
man <command>whenever you’re unsure what a command does. - ✅ Always quote file names with spaces:
"my file.txt". - ✅ Keep your system updated:
sudo apt update && sudo apt upgrade. - ⚠️ Be extremely careful with
rm -rf— double-check the path before hitting Enter. There is no “Recycle Bin” in Linux; deleted files are gone for good.
10. Practice Exercise & What’s Next
Before moving to Part 2, try this 5-minute exercise on your own server or VPS:
- Check where you are:
pwd - Create a folder called
practiceand move into it:mkdir practice && cd practice - Create a file:
echo "Hello Linux" > hello.txt - View it:
cat hello.txt - Check its permissions:
ls -l hello.txt - Compress it:
tar -czvf hello.tar.gz hello.txt - Confirm it worked:
ls -lh
If all seven steps ran without errors, congratulations — you’ve just used commands from four different categories in this guide. That’s real progress.
Want a safe place to practice?
Every command in this guide works exactly the same way on a real server. Spin up an affordable KwikServer Linux VPS and follow along with the whole series — it’s the fastest way to turn reading into real skill.
Get a Linux VPS →📚 Coming Up in This Series
- Part 1 (this article): Linux Commands — Your Quick Reference Cheat Sheet
- Part 2: Viewing Files & Content — Deep Dive into grep, sed, awk & Redirection
- Part 3: Permissions, Users & Groups — Complete Guide
- Part 4: Process & System Commands — Monitoring & Managing Your Server
- Part 5: Archive & Compress Files — tar, gzip, bzip2, zip Explained
- Part 6: Shell Scripting Basics — Automate Your First Task
- Part 7: Shell Scripting Basics II — Arrays, Functions & String Operations
- Part 8: User & Permissions Basics — SetUID, SetGID, Sticky Bit & Umask
- Part 9: System & Network Basics — Ports, Services & Logs
- Part 10: Advanced Essentials & Productivity — Cron, Firewalls & Job Control
Frequently Asked Questions
Do I need to memorize all these commands?
No. Even experienced sysadmins regularly use man or search online. What
matters is recognizing what a command category does, so you know where to look when you need it.
Is the Linux terminal the same on every distro (Ubuntu, Debian, CentOS)?
The core commands covered here (ls, cd, cat, grep, tar, etc.) work identically across
virtually all Linux distributions. Only package management commands differ — for example, Ubuntu/Debian use
apt, while CentOS/RHEL use yum or dnf.
What’s the safest way to practice without breaking anything?
Use a low-cost VPS specifically for practice, separate from any production server. That way, mistakes cost you nothing and you can freely experiment, reinstall, or reset the environment.
Next up: In Part 2, we’ll go much deeper into viewing and filtering file content —
including grep, sed, awk, pipes, and redirection — with real
log-file examples you’ll use constantly when managing a server.