Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command Index

Can’t remember the name of a command? No problem — this index is organized by what you want to do, not by section. Find your task below and jump straight to the command’s guide.

Tip: the built-in search bar (top of the sidebar) also indexes every page. But if you know the task and not the tool, this page is the fastest route.


I want to move around the filesystem

CommandOne-liner
pwdPrint the directory I’m currently in
cdChange the current directory
lsList the files and directories in a location
treeShow directories as an indented tree
catPrint a whole file to the screen
lessRead a large file one screen at a time
morePage through a file, the classic way

I want to create things

CommandOne-liner
mkdirCreate new directories
touchCreate an empty file or update a timestamp
cpCopy files and directories
mvMove or rename files and directories
lnCreate hard and symbolic links
teeWrite command output to a file (and the screen at once)
echoPrint a line of text (handy for writing files)
printfFormatted printing, the precise cousin of echo

I want to delete things

CommandOne-liner
rmdirRemove empty directories
rmRemove files (and directories with the right flags)

I want to find a file

CommandOne-liner
findSearch for files by name, size, date, and more
locateQuick file lookup from a prebuilt database
whichShow which executable the shell would run
whereisLocate a program’s binary, source, and man page
typeTell you what a command name actually is
lsofList which files processes have open (find a file by program)

I want to search inside files

CommandOne-liner
grepFind lines matching a pattern
sedStream-edit text with substitutions
awkPattern scanning and data extraction
lessSearch a large file interactively with /
diffCompare two files line by line
cmpCompare two files byte by byte

I want to count, sort, or reshape text

CommandOne-liner
sortSort lines of text
uniqReport or remove duplicate lines
wcCount lines, words, and bytes
cutExtract columns from text
pasteMerge lines of files side by side
trTranslate or delete characters
xargsBuild and run commands from input

I want to control where output goes

CommandOne-liner
RedirectionSend stdout/stderr to files with > and <
PipesChain commands together with |
teeSplit output to a file and the screen
stdin, stdout & stderrThe three standard streams, explained

I want to see what’s running

CommandOne-liner
psSnapshot of current processes
topLive, built-in process monitor
htopColorful, interactive process viewer
pgrepFind a process by name and get its PID
jobsList the shell’s background jobs

I want to kill a process

CommandOne-liner
killSend a signal to a process by PID
killallKill processes by name
pkillKill processes matching a pattern

I want to run something in the background or keep it alive

CommandOne-liner
bgResume a stopped job in the background
fgBring a job back to the foreground
nohupRun a command immune to hangups
waitWait for a background job to finish
systemd unitsRun services properly with systemd
niceStart a process with a given priority
reniceChange a running process’s priority

I want to watch system activity over time

CommandOne-liner
watchRe-run a command periodically and watch the output
timeMeasure how long a command takes
uptimeHow long the system has been up, and load averages
freeMemory usage at a glance
vmstatKernel-level virtual memory statistics
iostatCPU and input/output statistics
dmesgThe kernel ring buffer
journalctlQuery the systemd journal
The /var/log TourWhere the classic log files live

I want to know about my system

CommandOne-liner
unamePrint system and kernel information
hostnamectlShow and change the system hostname
dfReport file system disk space usage
duEstimate file and directory space usage
datePrint or set the date and time
calPrint a calendar

I want to learn how to use a command

CommandOne-liner
manRead the manual page for any command
infoThe GNU hyperlinked alternative to man
historyRecall and reuse previous commands
Keyboard ShortcutsSpeed up life at the prompt
Shell ScriptingWrite your own commands as scripts

I want to change file permissions or ownership

CommandOne-liner
chmodChange who can read, write, and execute a file
chownChange a file’s owner and group
chgrpChange a file’s group
umaskSet the default permissions for new files

I want to work with users and permissions

CommandOne-liner
sudoRun a single command as another user
suSwitch to another user account
idShow your user and group IDs
whoamiPrint the current username
passwdChange a password
useraddCreate a new user account
/etc/passwdThe file that defines every user

I want to understand how the system fits together

PageWhat it covers
What Is Linux?Distributions, the kernel, and the big picture
Terminal vs Shell vs KernelThe three layers you keep confusing (now you won’t)
Opening a TerminalGetting to a prompt on any distro
Filesystem HierarchyWhere everything lives: /, /etc, /home, and friends
stdin, stdout & stderrThe three standard streams
Environment VariablesVariables that shape your shell’s world
$PATHHow the shell finds your commands
AliasesShortcuts for long commands
bash / sh / zshWhich shell you’re using and why it matters

I want to install or remove software

CommandOne-liner
aptThe Debian/Ubuntu package manager
dnfThe Fedora/RHEL package manager (and legacy yum)
pacmanThe Arch Linux package manager
snapUbuntu’s containerized app packages
flatpakDesktop apps sandboxed across distros

I want to transfer files between machines

CommandOne-liner
scpCopy files over SSH
rsyncSync files efficiently, locally or remotely
sshLog in to a remote machine
curlTransfer data with URLs (the Swiss army knife)
wgetDownload files from the web

I want to inspect or fix the network

CommandOne-liner
ipShow and manage interfaces, routes, addresses
ifconfigThe classic (deprecated) interface viewer
pingTest whether a host is reachable
ssShow socket statistics
netstatThe classic network statistics tool
tracerouteShow the path packets take to a host
digQuery DNS records
nslookupLook up DNS names interactively
hostA simple DNS lookup utility
tcpdumpCapture and inspect network traffic
ncRead/write data across network connections

I want to bundle or compress files

CommandOne-liner
tarBundle many files into one archive
gzipCompress a single file with DEFLATE
zipCreate and read .zip archives
xzHigh-ratio compression
bzip2Block-sorting compression (better ratio than gzip)
ddConvert and copy raw data (ISOs, backups, disks)

I want to debug a misbehaving program

CommandOne-liner
straceTrace system calls a program makes
ltraceTrace library calls a program makes
lsofSee which files and sockets a process holds open
journalctlRead the logs of a failing service
dmesgCheck the kernel for crashes and errors

I want to work with Git and GitHub

PageOne-liner
Git CommandsThe everyday Git workflow
GitHub CLI SetupInstall and configure gh

I want to secure my keys and sessions

PageOne-liner
GPG Key SetupGenerate and manage GPG keys
SSH CommandsRemote login, keys, and tunneling

I want to work with containers

PageOne-liner
DockerBuild and run containers
SwarmOrchestrate a cluster of Docker hosts
StackDeploy stacks with Docker Stack
CI/CDShip containers with continuous integration
Security Best PracticesHarden your containers
Performance TipsMake containers faster and lighter

I want to download videos

CommandOne-liner
yt-dlpDownload videos from thousands of sites

Can’t find what you’re looking for? Try the search bar, or browse the full table of contents in the sidebar.