OS Guides

Ubuntu for Hard Interference: Surviving the Terminal

The terminal isn't scary — it's just text. Here's every command you actually need to get comfortable on Ubuntu's command line.

2026-04-27 · 7 min read

Let's get one thing straight: the terminal is not a hacker movie prop. It's just a faster way to tell your computer what to do. No clicking through menus, no waiting for animations, no "are you sure?" dialogs every three seconds. You type a command, it happens.

That said, the terminal doesn't hold your hand. Type the wrong thing and it'll do exactly what you told it — even if that wasn't what you meant. So let's learn the commands that matter, in the order you'll actually need them.

Opening the terminal

Press Ctrl+Alt+T. That's it. A black rectangle appears with something like:

raf@ubuntu:~$

That's your prompt. It tells you: your username (raf), your machine name (ubuntu), and your current directory (~, which means your home folder).

Navigation — Moving Around

Before you can do anything, you need to know where you are and where you're going.

Where am I?

pwd

Print Working Directory. Tells you exactly where you are in the file system. Like checking the map.

What's here?

ls

Lists files and folders in the current directory. Add flags for more detail:

ls -la    # Long format + hidden files (the -a shows dotfiles)
ls -lh    # Long format + human-readable file sizes

Going somewhere

cd Documents       # Go into the Documents folder
cd ..              # Go up one level
cd ~               # Go home (same as just typing cd)
cd /etc            # Go to /etc (absolute path)
cd -               # Go back to wherever you just were

Making and removing directories

mkdir projects     # Create a directory called "projects"
mkdir -p a/b/c     # Create nested directories all at once
rmdir projects     # Remove an empty directory
rm -rf projects    # Remove a directory AND everything in it (USE WITH CARE)

That -rf flag is the one that bites. r means recursive (go into subdirectories), f means force (don't ask for confirmation). There's no recycle bin. It's gone. Double-check what you're deleting.

Files — Creating, Moving, Copying, Deleting

touch notes.txt           # Create an empty file
cp notes.txt backup.txt   # Copy a file
mv notes.txt archive/     # Move a file into a directory
mv old.txt new.txt        # Rename a file (move = rename in Linux)
rm notes.txt              # Delete a file

To read a file without opening an editor:

cat notes.txt       # Print entire file to terminal
head -20 file.txt   # First 20 lines
tail -20 file.txt   # Last 20 lines
less file.txt       # Scrollable viewer (press q to quit)

Package Management — Installing Software

This is where Ubuntu shines. Instead of Googling for .exe files, you do this:

sudo apt update              # Refresh the list of available packages
sudo apt upgrade -y          # Update everything that's installed
sudo apt install flameshot   # Install a specific package
sudo apt remove flameshot    # Uninstall it
sudo apt autoremove          # Clean up orphaned dependencies

apt is your package manager. Think of it as an app store that runs in a terminal. The sudo prefix means "do this as the administrator" — it'll ask for your password the first time, then remember it for 15 minutes.

Finding packages

apt search screenshot        # Search for packages matching "screenshot"
apt show flameshot           # Get details about a specific package

The .deb fallback

Some software (like Google Chrome) comes as a .deb file instead:

sudo dpkg -i chrome-stable.deb      # Install from .deb file
sudo apt install -f                  # Fix any missing dependencies

Permissions — Why Things Say "Access Denied"

Linux is serious about who can do what. Every file has an owner, a group, and a set of permissions.

ls -l notes.txt
# -rw-r--r-- 1 raf raf 42 Apr 27 02:00 notes.txt

Those first characters break down as:

Changing permissions

chmod +x script.sh        # Make a file executable
chmod 755 script.sh       # Set specific permissions (owner: all, others: read+execute)
chown raf:raf file.txt    # Change the owner of a file (needs sudo for files you don't own)

The chmod numbers: 7=rwx, 6=rw-, 5=r-x, 4=r--, 0=---. Each digit is owner, group, others.

sudo — The Root Password

sudo gives you temporary admin powers. It's the Linux equivalent of "Run as Administrator". Use it when you need it, but don't live in a root shell. One typo with root access can obliterate your system.

The File System — Where Everything Lives

Linux doesn't use C: or D: drives. Everything is a directory under /.

PathWhat's There
/home/rafYour files. This is your ~
/etcSystem configuration files
/varVariable data — logs, databases, caches
/usrUser programs and libraries
/optThird-party software
/tmpTemporary files (cleared on reboot)
/bin, /sbinEssential system binaries
/devDevice files (drives, USB, etc)
/procVirtual filesystem — live kernel info

The golden rule: don't touch anything outside /home unless you know what it does. Your stuff lives in /home. System stuff lives everywhere else.

Finding Things

which python3          # Where is a command located?
find / -name "*.conf"  # Find all .conf files (slow, searches everything)
locate notes.txt       # Fast find (uses a database, run sudo updatedb first)
grep -r "TODO" .       # Search for "TODO" inside all files in current directory

grep is genuinely one of the most useful commands you'll ever learn. It searches inside files, not just filenames. I use it daily.

Piping and Redirection — The Power Moves

This is where the terminal goes from "useful" to "actually incredible."

Redirection

ls -la > filelist.txt      # Save output to a file (overwrites)
ls -la >> filelist.txt     # Append output to a file
sort < names.txt           # Use a file as input

Piping

The pipe | takes the output of one command and feeds it into the next:

ls -la | grep ".txt"              # List files, but only show .txt ones
cat access.log | grep "404" | wc -l   # Count how many 404 errors in a log
history | grep "apt install"       # Find every package you've ever installed
dpkg -l | grep -i python           # Check if python is installed

Pipes chain commands together like a production line. Each command does one thing well, and piping lets you combine them into powerful workflows.

Practical Example: Install and Configure a Tool

Let's put it all together. Say I want to install htop (a better task manager) and check it's working:

sudo apt update && sudo apt install htop -y    # Update + install in one line
which htop                                     # Confirm it installed
htop                                           # Run it (press q to quit)

The && means "run the next command only if the previous one succeeded." It's safer than ; which runs regardless.

Man Pages — The Built-in Manual

Every command has documentation built in:

man ls           # Full manual for ls
man apt          # Full manual for apt

Press q to quit, / to search within the page, n to find the next match. Yes, it's old-school. It's also always there, even without internet.

The Commands You'll Actually Use Daily

Memorise these and you'll be fine:

pwd             # Where am I?
ls -la          # What's here?
cd              # Go home
cd somewhere    # Go somewhere
mkdir name      # Make a directory
cp src dest     # Copy
mv src dest     # Move / rename
rm file         # Delete a file
rm -rf dir      # Delete a directory (careful)
cat file        # Read a file
grep pattern    # Search for text
sudo apt update && sudo apt upgrade -y  # Update everything
sudo apt install name   # Install something
history         # What did I type before?
clear           # Clean the screen

That covers about 90% of daily terminal usage. The rest you'll pick up as you need it.

The terminal isn't something to fear — it's something to earn. Every command you memorise is a click you never have to make again. Start with these, and within a week you'll wonder how you ever managed without it.

➜ Previous: Ubuntu for Hard Interference: From USB to Desktop ➜ Next: Ubuntu for Hard Interference: Screenshots, Shortcuts & Going Pro


Found this useful? 👉 Follow @Raf_VRS for more Hard Interference OS guides that put you in control of your hardware. Stop Scrolling. Start Building.

👉 Support independent tech writing: ko-fi.com/rafvrs

#HardInterference #Ubuntu #LinuxTerminal