Linux Commands Cheat Sheet

WebTerm Learn · Updated · CC BY 4.0

112 everyday Linux commands and shortcuts with examples, on three A4 landscape pages.
The PDF is free and prints as is. No sign-up.

Click a command to open the lesson where you practice it.
A red ! marks a command you cannot undo.

Linux Commands Cheat Sheet

Working with files

1 / 3

List what is insidels

lsList the current directory
ls DocumentsList another directory without moving
ls -aInclude hidden files
ls -lShow permissions, size and date
ls -R appList every level below

Compress and extracttar

tar -tf backup.tar.gzList contents before extracting

Create and deletetouch, mkdir, rm, ln

touch memo.txtCreate an empty file
mkdir projectsCreate a directory
mkdir -p app/src/componentsCreate nested directories at once
rm trash.txtDelete a file!
rm -r old_projectDelete a directory and everything in it!
rmdir empty_dirDelete an empty directory

Move and copymv, cp

mv memo.txt docsMove into a directory
mv -n file02.txt projectsSkip if the name is taken
cp -r photos photos_backupCopy a directory and its contents
cp -i data.txt data.txt.bakAsk before overwriting

Read filescat, head, tail, less

cat index.htmlPrint the whole file
head log.txtShow the first lines
tail -n 5 log.txtShow the last 5 lines
less readme.txtRead page by page
SpacenextGendqquit
WebTerm LearnCC BY 4.0 WebTerm Learn · October 2026 edition · Practice every command in a browser terminal at learn.webterm.app

Linux Commands Cheat Sheet

Using the shell

2 / 3

Keyboard shortcutsTab, Ctrl

$echo helloworldCtrl+UCtrl+KCtrl+WCtrl+A line startCtrl+E line end
Tab
Complete a name
↑
Bring back the previous command
Ctrl+A/Ctrl+E
Jump to start / end of line
Ctrl+K
Delete to the end of the line
Ctrl+U
Delete to the start of the line
Ctrl+W
Delete the previous word
Ctrl+Y
Paste what you just deleted
Ctrl+C
Stop the running command

Use your historyhistory, !!, clear

historyList the commands you ran
!!Run the last command again
clearClear the screen

Match many files at once*, ?, [ ], { }

What the symbols match
*Any number of characters
?Exactly one character
[abc]One of a, b or c
{1..5}Expands to 1 2 3 4 5
mv *.txt backupMove every .txt file
ls report_?.txtNames differing by one character
ls report_[abc].txtNames with one of the listed characters
touch log_{1..5}.txtCreate numbered files at once
cat "project/my notes.txt"Quote names that contain spaces

Pipes and redirection|, >, >>

server.loggrep|sort>errors.txt| to the next command> write a file>> append
grep "ERROR" server.log | sortSend the output to the next command
grep "ERROR" server.log | sort > errors.txtWrite the output to a file (overwrite)
grep "WARN" server.log >> errors.txtAppend to the end of a file

Make the shell your ownalias, source, export

echo $SHELLShow which shell you use
alias rm="rm -i"Create a shortcut (alias)
aliasList your aliases
\rm notes.txtRun a command without its alias
echo 'alias rm="rm -i"' >> ~/.zshrcSave it in your config file
source ~/.zshrcReload the config
PS1=">> "Change the prompt
KEY=val
export EDITOR=vimSet an environment variable
printenv EDITORShow its value
echo $PATHShow where commands are looked up

Permissionschmod

ls -l shows-rwxr-xr-x→ chmod 755Ownerr w x4+2+1 = 7Groupr - x4+0+1 = 5Othersr - x4+0+1 = 5
ls -lCheck permissions
chmod 755 deploy.shYou: all; others: read and run
chmod 644 index.htmlYou: read and write; others: read
chmod 600 id_rsaOnly you can read and write
WebTerm LearnCC BY 4.0 WebTerm Learn · October 2026 edition · Practice every command in a browser terminal at learn.webterm.app

Linux Commands Cheat Sheet

Managing a server

3 / 3

Superuser and userssudo, useradd, usermod

sudo cat /etc/hostnameRun as the superuser
idShow your user and groups
sudo useradd aliceCreate a user
sudo usermod -aG developers aliceAdd to a group (keep the others)
groups aliceShow which groups a user is in
sudo userdel aliceDelete a user!

Install softwareapt

sudo apt updateRefresh the package list
apt search nginxSearch for a package
sudo apt upgradeUpgrade what is installed
apt list --installedList what is installed

Schedule jobscrontab

crontab -lList scheduled jobs
crontab backup-cron.txtInstall jobs from a file
crontab -rDelete all scheduled jobs!

Processes and servicesps, kill, systemctl

1021 nginx3456 python34102 sshd
ps auxList every running process
ps aux | grep python3Find a process
kill 3456Stop a process!
lsof -i :80Find what uses a port
systemctl status nginxCheck a service
sudo systemctl enable nginxStart it automatically at boot
journalctl -u nginxRead its logs

Web and APIscurl

Check the systemuname, df, du, free

uname -aOS and kernel version
df -hDisk usage
du -sh /var/logTotal size of a directory
free -hMemory usage

Networkingip, ping

YoulocalhostRouterfind it with ip routeRemote serverwebterm.app
hostnameShow the machine name
ip addrShow IP addresses
ip routeShow the route out (the router)
ping -c 3 webterm.appCheck that a host is reachable

Connect with SSHssh, ssh-keygen

You: private keyServer: public keyssh-copy-id registers your keyssh logs in, no password
ssh-keygen -t ed25519Create a key pair
cat ~/.ssh/id_ed25519.pubShow your public key
ssh-copy-id user@server.example.comRegister your key on the server
ssh user@server.example.comConnect to the server
exitDisconnect
WebTerm LearnCC BY 4.0 WebTerm Learn · October 2026 edition · Practice every command in a browser terminal at learn.webterm.app

Save or share as images

One PNG per page (2246×1588). Post them or drop them into your team docs.

Linux commands cheat sheet, page 1: Working with files
Open page 1
Linux commands cheat sheet, page 2: Using the shell
Open page 2
Linux commands cheat sheet, page 3: Managing a server
Open page 3

FAQ

Is this cheat sheet free?
Yes. There is no sign-up. Download the PDF or the images straight from this page.
How do I print it?
Download the PDF and print it on A4 paper in landscape orientation. It is 3 pages, one sheet per page.
Can I hand it out in a class or at work?
Yes. It is licensed under CC BY 4.0, so you can share and adapt it as long as you credit WebTerm Learn (learn.webterm.app).
Where can I practice these commands?
In the WebTerm Learn terminal courses, which you play through like a game, right in your browser. Every command on the sheet links to the lesson that teaches it.

License

CC BY 4.0. Share it, adapt it and use it in classes or training, as long as you credit WebTerm Learn (learn.webterm.app). CC BY 4.0