← All resources

The terminal without fear.

You do not need to memorise hundreds of commands. Start with ten, learn what each one changes, and let the manual handle the rest.

A Raspberry Pi 5 single-board computer mounted beside a small SSD and an ethernet cable on a wooden desk, softly lit in tungsten.
The terminal is where the work happens. You can also use a Linux desktop without ever touching it. But every homelab you might want to build starts on a Raspberry Pi, and on a Pi you live in the terminal.

Start by looking, not changing

pwd shows where you are. ls shows what is there. cd moves between folders. These three commands are the terminal equivalent of opening folders in a file manager.

pwd
# /home/ubuntu
ls -la
# drwxr-xr-x  4 ubuntu ubuntu 4096 Jul 16 11:00 Documents
# drwxr-xr-x  2 ubuntu ubuntu 4096 Jul 14 09:00 Downloads
# -rw-r--r--  1 ubuntu ubuntu  120 Jul 13 18:21 README.md
cd ~/Documents
pwd
# /home/ubuntu/Documents

Create, copy, move, remove

mkdir creates a directory, cp copies, mv moves or renames, and rm removes. Before using rm, run pwd and ls. Linux assumes you meant what you typed.

mkdir practice
cp notes.txt practice/
mv practice/notes.txt practice/linux-notes.txt
rm practice/linux-notes.txt

Read files and get help

less opens long text one screen at a time. grep searches text. man opens the built-in manual — every command on the system has one.

less /var/log/syslog
grep -i "error" /var/log/syslog
man grep

Update and install

Most everyday Linux administration comes down to two commands: apt update followed by apt upgrade. The first refreshes the list of available packages; the second installs the upgrades.

sudo apt update
sudo apt upgrade -y
sudo apt install htop
sudo apt remove htop

Find what is happening

ps lists running processes. top (and the prettier htop) shows live CPU and memory use. df -h shows disk space. These four commands answer the most common “why is my machine slow” questions.

top
df -h
free -h
ps aux | grep nginx

Permissions and ownership

Every file has an owner, a group, and three permission bits per role. ls -l reads them. chmod changes them. chown changes the owner. You will see chmod +x in almost every tutorial.

ls -l /usr/local/bin/script.sh
# -rwxr-xr-x 1 root root 1.2K Jul 15 14:00 /usr/local/bin/script.sh
chmod +x script.sh
chown ubuntu:ubuntu file.txt

The one safety habit that matters

Do not paste commands you do not understand, especially commands beginning with sudo. Break a long command into pieces, inspect paths first, and use the manual when a flag is unfamiliar.

The terminal is not a place where clever happens. It is a place where transparent happens. Every keystroke records, every command documents itself in man, every change can be undone (mostly). The Linux Institute team

What to learn next

Back to all resources →