On this page

Every command in the guide on one page. Each row links to the chapter that explains it in full. Chapters 0 and 1 are onboarding and overview pages with no commands.

Command What it does Chapter
pwd print the current directory Ch 2
ls list files and directories Ch 2
cd change directory Ch 2
find search by name, type, age or size Ch 2
locate fast search of a filename database Ch 2

Files & Directories

Command What it does Chapter
mkdir create a directory Ch 3
touch create an empty file / update its timestamp Ch 3
cp copy files and directories Ch 3
mv move or rename Ch 3
rm delete files (no undo) Ch 3
ln create hard links and symlinks Ch 3
file tell what kind of file something is Ch 3

Reading & Editing Files

Command What it does Chapter
cat print a file to the terminal Ch 4
less page through long files Ch 4
head show the first lines Ch 4
tail show the last lines, or follow a log Ch 4
nano a beginner-friendly terminal editor Ch 4
echo print text Ch 4

Permissions & Ownership

Command What it does Chapter
chmod change permissions (numeric or symbolic) Ch 5
chown change the owner / group Ch 5
chgrp change the group Ch 5
umask set default permissions for new files Ch 5
id show user, group and IDs Ch 5
whoami print your username Ch 5
sudo run a command with root privileges Ch 5

Processes & System

Command What it does Chapter
ps list running processes Ch 6
top live process list, sorted by CPU Ch 6
htop friendlier interactive process monitor Ch 6
watch re-run a command and show changes Ch 6
kill send a signal to a process Ch 6
pgrep find process IDs by name Ch 6
pkill send signals to processes by name Ch 6
killall kill processes by exact name Ch 6
uptime how long the system has been running Ch 6
free memory and swap usage Ch 6

Package Management

Command What it does Chapter
apt install/update packages (Ubuntu/Debian) Ch 7
dnf install/update packages (Fedora) Ch 7
pacman install/update packages (Arch) Ch 7

Text Processing

Command What it does Chapter
grep search for text Ch 8
sed edit text line by line Ch 8
awk field-based text processing Ch 8
cut extract columns by delimiter Ch 8
sort order lines Ch 8
uniq remove adjacent duplicates Ch 8
wc count lines, words and bytes Ch 8
diff show differences between files Ch 8
tac print a file in reverse line order Ch 8
nl number the lines of a file Ch 8
column align text into a table Ch 8
comm compare two sorted files Ch 8
tr translate or squeeze characters Ch 8
xargs turn stdin into command arguments Ch 8

Archives & Compression

Command What it does Chapter
tar bundle files into an archive Ch 9
gzip / gunzip compress / decompress a single file Ch 9
zip / unzip archives that compress Ch 9
xz stronger compression than gzip Ch 9

Networking

Command What it does Chapter
ping is the host reachable? Ch 10
ip addresses, routes, interfaces Ch 10
curl transfer data from URLs Ch 10
wget download files Ch 10
dig DNS lookups Ch 10
ss sockets and open ports Ch 10
traceroute show the path a packet takes Ch 10
nmcli network settings via NetworkManager Ch 10

Remote Access & File Transfer

Command What it does Chapter
ssh connect to a remote machine Ch 11
ssh-keygen create an SSH key pair Ch 11
ssh-copy-id install your SSH key on a server Ch 11
scp copy files over SSH Ch 11
rsync smart file sync / backup Ch 11
sftp interactive file transfer over SSH Ch 11

Disks & Storage

Command What it does Chapter
df disk space per filesystem Ch 12
du disk usage of a directory tree Ch 12
lsblk list block devices and partitions Ch 12
blkid show filesystem UUIDs (needs root) Ch 12

Shell Essentials

Command What it does Chapter
man read a command’s manual page Ch 13
apropos search man pages by keyword Ch 13
which find where a command lives Ch 13
type shell builtin or separate program? Ch 13
history your command history Ch 13
alias short names for commands Ch 13
export make a variable visible to child processes Ch 13
tee write to a file and the screen Ch 13
nohup keep a job running after logout Ch 13
jobs list this shell’s background jobs Ch 13
fg / bg resume a job in the foreground / background Ch 13
tmux terminal multiplexer Ch 13

Services & Logs

Command What it does Chapter
systemctl control services Ch 14
journalctl read the system log Ch 14
zcat view gzipped text files Ch 14
zgrep grep gzipped text files Ch 14

Automation

Command What it does Chapter
cron the scheduler service Ch 15
crontab manage scheduled tasks Ch 15
date print the current date and time Ch 15
bash run a shell script Ch 15