Unix Tutorial for Beginners: Learn Unix & Linux Commands Step by Step

By Softlookup Editorial Team · Updated April 25, 2026 · 25 min read · Free 47-chapter course

One tutorial, three operating systems. The skills in this Unix tutorial work on every Linux distribution (Ubuntu, Debian, Red Hat, Arch, Fedora) and on macOS Terminal. About 95% of commands are identical. If you can navigate, edit files, write shell scripts, and use vi on Unix — you can do all of it on Linux and Mac too.
47
free chapters
~30 hrs
total study time
1969
Unix first released
~80%
of servers run Unix-like OS

What Is Unix?

Unix is an operating system family that started at AT&T Bell Labs in 1969. It introduced ideas that are now everywhere: hierarchical file systems, the shell, pipes (|), text-based system configuration, and "do one thing well" command-line tools.

Unix itself isn't free or open source (the original is owned by The Open Group). But its ideas spawned a whole family of compatible systems: Linux, FreeBSD, OpenBSD, macOS, Solaris, AIX, and HP-UX. When people say "Unix" today, they usually mean "Unix-like" — including Linux and macOS.

Unix vs Linux vs macOS: What's the Difference?

SystemWhat It IsWhere You'll See It
Original Unix1969 AT&T system, now mostly historicalLegacy enterprise: Solaris, AIX, HP-UX
LinuxFree Unix-like OS (1991, Linus Torvalds)~80% of web servers, all Android devices, most cloud servers
BSDBerkeley Software Distribution — Unix derivativesFreeBSD, OpenBSD, NetBSD, foundation of macOS and PlayStation
macOSBSD-based, Unix-certified by The Open GroupEvery Mac since 2001
WSLWindows Subsystem for LinuxLinux on any Windows 10/11 machine

Practically, when learning: Unix commands work on all of these. Open Terminal on macOS, open WSL on Windows, SSH into a Linux server — the commands you learn here work everywhere.

Why Learn Unix in 2026?

Three honest reasons it's still one of the most valuable skills you can pick up:

  1. Every server runs it. Linux dominates web hosting, cloud computing, Docker containers, and Kubernetes. AWS, Google Cloud, and Azure are Linux-first. If you deploy software, you deploy to Unix-like systems.
  2. The skills compound. Once you know Unix, you can use 10 different distributions, several BSDs, and macOS Terminal without re-learning anything. No other operating system family has this much portability.
  3. Command-line skills make you faster. A skilled Unix user does in 30 seconds what a GUI user does in 5 minutes. Bulk file rename, log searching, batch processing — all trivial on the command line.

How to Practice Unix (No Install Required)

Three options ranked by ease:

OptionBest ForSetup
macOS TerminalMac users — you already have itPress Cmd+Space, type "Terminal", hit Enter
WSL on WindowsWindows 10 or 11 usersOpen PowerShell as admin, run wsl --install
Linux in a browserAnyone with a browserOnline Unix terminal or Replit
Cloud shellAny free Google accountGoogle Cloud Shell — 5GB free shell
Live Linux from USBTry without installingDownload Ubuntu .iso, write to USB with Rufus or balenaEtcher
Recommended for beginners: If you're on Windows, install WSL today. wsl --install in PowerShell (as admin) gets you a real Ubuntu environment that runs alongside Windows, with full file system integration. It's the modern way to learn Unix on Windows.

Your First 10 Unix Commands

Open a terminal anywhere and try these. Every one works on Unix, Linux, and macOS.

# 1. Where am I?
$ pwd
/home/alice

# 2. What's in this folder?
$ ls
Documents  Downloads  Pictures  notes.txt

# 3. Detailed listing (size, date, permissions)
$ ls -la

# 4. Change directory
$ cd Documents

# 5. Make a new folder
$ mkdir my-project

# 6. Create or edit a file
$ touch notes.txt     # empty file
$ nano notes.txt      # open in nano editor

# 7. View a file
$ cat notes.txt       # whole file at once
$ less notes.txt      # scrollable, press q to quit

# 8. Copy a file
$ cp notes.txt backup.txt

# 9. Move/rename a file
$ mv notes.txt my-notes.txt

# 10. Delete a file (careful — no undo)
$ rm backup.txt

That's it. Master those 10 and you can navigate any Unix system. The rest of this tutorial builds from these.

The Unix File System

Unix organizes everything as a tree of directories starting at / (the "root"). Even hardware devices and running processes show up as files. The most important locations:

PathWhat's There
/Root of the file system (everything is below this)
/home/usernameYour home directory (also ~)
/etcSystem configuration files
/bin and /usr/binEssential commands (ls, cp, mv, etc.)
/usr/localSoftware installed by you or a package manager
/varVariable data — logs, mail, databases
/tmpTemporary files (deleted on reboot)
/devDevice files — disks, USB, terminals
/procLive view of running processes (Linux)

Pipes: The Unix Superpower

Unix's most important idea: small tools that combine. The pipe | sends one command's output to another's input. Master this, and you can do almost anything in one line.

# Find the 5 largest files in the current directory
$ ls -la | sort -k5 -nr | head -5

# Count how many .txt files are here
$ ls *.txt | wc -l

# Find every line containing "error" in any log file
$ grep -r "error" /var/log/

# Show only unique users currently logged in
$ who | awk '{print $1}' | sort -u

# Find all running Python processes, sorted by memory
$ ps aux | grep python | sort -k6 -nr

Each command does one thing. Combined, they solve real problems.

The Vi Editor (Why You Need to Know It)

vi (or its successor vim) is the most universally available text editor on Unix systems. Even on minimal Linux installs that have nothing else, vi is there. Learning enough to be functional takes about 30 minutes.

ActionKeys
Open a filevi filename.txt
Enter insert mode (start typing)Press i
Exit insert modePress Esc
Save:w then Enter
Save and quit:wq then Enter
Quit without saving:q! then Enter
UndoPress u (in normal mode)
Search/ + search term + Enter
Delete current linePress dd twice
Copy current linePress yy twice
PastePress p
Common stumbling block: If you opened vi and typed text but it doesn't appear — that's because vi starts in command mode, not insert mode. Press i first, then type. Press Esc when done, then :wq to save and quit.

Shell Scripting in 5 Minutes

A shell script is just a file containing commands you'd normally type. Save them in a .sh file, make it executable, run it like a program.

#!/bin/bash
# A simple backup script

DATE=$(date +%Y-%m-%d)
BACKUP_DIR="/home/alice/backups"

echo "Starting backup for $DATE"

mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/backup-$DATE.tar.gz /home/alice/Documents

echo "Backup complete:"
ls -lh $BACKUP_DIR/backup-$DATE.tar.gz

Save that as backup.sh, then:

$ chmod +x backup.sh    # Make it executable
$ ./backup.sh            # Run it

Add it to cron and it runs automatically every night. That's the foundation of every Unix sysadmin's job.

Common Beginner Mistakes

1. Using rm Without Thinking

rm doesn't move files to a trash folder — it deletes them immediately and permanently. rm -rf / as root will destroy your system. Always check what directory you're in before rm.

2. Forgetting Case Sensitivity

Unix is case-sensitive. readme.txt and Readme.txt are different files. cd Documents and cd documents aren't the same command.

3. Spaces in Filenames

Either avoid them, or quote them:

# Broken:
$ cat my notes.txt     # tries to open "my" AND "notes.txt"

# Fixed:
$ cat "my notes.txt"
$ cat my\ notes.txt     # escape with backslash

4. Running Things as Root When You Don't Need To

sudo gives you root power. Use it only for system administration tasks. Routine work (editing your own files, running your own programs) should never need sudo.

5. Closing the Terminal While a Process Is Running

Closing the terminal kills running processes. If you need a long-running task to survive, prefix with nohup or use tmux/screen:

$ nohup long-script.sh &

Complete Learning Path

The 47 chapters below cover everything from "what's an operating system" to advanced system administration. Work through them in order, or jump to the section that fills your specific gap.

Part IV — Programming on Unix (Chapters 15–17)

  1. Awk, Awk
  2. Perl
  3. The C Programming Language

Part V — Processes (Chapters 18–20)

  1. What Is a Process?
  2. Administering Processes
  3. Scheduling Processes

Part VII — Source Control & Backup (Chapters 30–32)

  1. Source Control with SCCS and RCS
  2. Archiving
  3. Backups
Start Chapter 1: Operating System →

Unix Command Cheat Sheet

The 30 commands that handle 90% of daily Unix work:

TaskCommand
Show current directorypwd
List filesls (basic) or ls -la (detailed)
Change directorycd /path/to/dir or cd ~ (home)
Make directorymkdir new-folder
Remove empty directoryrmdir empty-folder
Remove filerm file.txt
Remove directory + contentsrm -rf folder/ (careful!)
Copy filecp source.txt dest.txt
Copy directorycp -r source/ dest/
Move/renamemv old.txt new.txt
View filecat file.txt or less file.txt
First/last 10 lineshead file.txt / tail file.txt
Search inside filesgrep "text" file.txt
Recursive searchgrep -r "text" .
Find files by namefind . -name "*.txt"
Count lineswc -l file.txt
Sort linessort file.txt
Unique lines onlysort file.txt | uniq
Disk usagedu -sh folder/
Free disk spacedf -h
Running processesps aux or top
Kill processkill PID or kill -9 PID
Make executablechmod +x script.sh
Change ownershipchown user:group file
Become rootsudo command
Manual pageman ls
Where is a command?which python
Compress foldertar -czf archive.tar.gz folder/
Extract archivetar -xzf archive.tar.gz
Download a filewget URL or curl -O URL

Frequently Asked Questions

Is Unix the same as Linux?

Not exactly, but for learning purposes the difference rarely matters. Unix is the original from 1969. Linux is a Unix-like OS from 1991 that copied Unix's design and behavior. macOS is also Unix-certified. Commands you learn for Unix work on Linux and macOS in 95%+ of cases.

Why should I learn Unix in 2026?

Almost every server runs Linux (a Unix descendant). Cloud services (AWS, GCP, Azure) are Linux-first. Docker containers run Linux. macOS Terminal is Unix. Knowing Unix is one of the highest-leverage skills in modern computing.

Is Unix hard to learn?

The first week is steep — the command line feels alien if you've only used Windows or Mac GUIs. After about 20 hours of practice, most people feel comfortable. You only need a few dozen commands to be productive.

Where can I practice Unix without installing anything?

Free options: Online terminal sites, Replit Linux containers, Google Cloud Shell (free 5GB shell), or GitHub Codespaces. If you have a Mac, the Terminal app is already Unix. If you have Windows, install WSL.

Should I learn bash or zsh?

Learn bash first — it's the default on most Linux servers and most widely documented. zsh is the default on modern macOS and adds nice features, but it's mostly compatible with bash.

What's the difference between Unix shells?

sh (1977) is the original. bash is sh-compatible with extras and is most common today. zsh is bash-like with more features, default on macOS. ksh is common on enterprise Unix. csh and tcsh have C-like syntax. For new learners: just use bash.

How long does it take to learn Unix?

Basic file commands: 1-2 hours. Comfortable in the terminal: 1-2 weeks. Shell scripting: another 2-3 weeks. System administration basics: 2-3 months. Most developers reach productive level in about 30 hours.

What jobs require Unix skills?

DevOps engineer, SRE, system administrator, cloud engineer, backend developer, security engineer, data engineer, and bioinformatics researcher all require Unix skills. Salaries for Unix-heavy roles typically run 15-30% above general developer roles.

Start Chapter 1: Operating System →

Last updated: April 25, 2026.