Skip to content

Introduction to Linux Terminal

💡
Before you start

You need nothing but a Linux machine and five minutes. No installation, no account, no sudo, and nothing you type here can damage anything — every command either just looks at something or works inside a practice folder you create and can delete when you are done. This page is the starting point for every other Linux tutorial on this site. If you have never opened a terminal before, that is exactly who it is written for.

What is the Terminal?

The terminal (also called command line, shell, or console) is a text-based interface that allows you to interact with your computer using typed commands instead of clicking buttons and menus.

Think of it like this: the graphical interface (GUI) is like ordering food by pointing at pictures on a menu, while the terminal is like telling the chef exactly what you want in precise words.

💡
Why learn the terminal?

Many powerful tasks can only be done through the terminal. System administration, automation, security tools, and programming all rely heavily on command-line skills.

Opening the Terminal

Every Linux distribution includes a terminal application. Here's how to open it:

Method 1: Keyboard Shortcut (Fastest)

On most Linux distributions, press:

Ctrl + Alt + T

This instantly opens the default terminal application.

Method 2: Application Menu

1
Click the Activities button (top-left corner) or press the Super key (Windows key)
2
Type "Terminal" in the search box
3
Click the Terminal icon to open it

Understanding the Terminal Interface

When you open the terminal, you'll see something like this:

username@hostname:~$ 

Let's break this down:

username Your login name on the system
@ Separator between username and hostname
hostname Your computer's name
: Separator before the current directory
~ Current directory (~ means your home folder)
$ Indicates you're a regular user (# means root/admin)

Your First Command

Let's try a simple command. Type the following and press Enter:

whoami

This command displays your username. The output will look like:

username@hostname:~$ whoami
john
⚠️
Be careful with commands!

The terminal is powerful. Some commands can modify or delete files permanently. Always double-check commands before pressing Enter, especially those starting with sudo or rm.

Essential Tips for Beginners

  • Case sensitivity: Linux commands are case-sensitive. whoami is different from WHOAMI.
  • Tab completion: Press Tab to auto-complete commands and file names.
  • Command history: Press and to navigate through previous commands.
  • Clear screen: Type clear or press Ctrl + L to clear the terminal.
  • Cancel command: Press Ctrl + C to stop a running command.

Now Do It Yourself: Six Steps

Reading about a terminal teaches almost nothing; five minutes of using one teaches a great deal. These six steps take you from never having opened it to moving around confidently and reading the errors it gives you. Nothing here needs sudo, and nothing touches anything outside a folder you create.

1
Open the terminal and find out where you are

Go: press Ctrl + Alt + T. On most desktops that opens a terminal immediately; if nothing happens, open your applications menu and search for Terminal.

Do: type pwd and press Enter. Then type whoami and press Enter.

You should see: a path such as /home/yourname, then your username on its own line. pwd stands for "print working directory" — a terminal is always somewhere, and that somewhere is what most commands act on. You start in your home folder.

If not: if the window shows a >>> prompt instead of something ending in $, you are inside Python rather than the terminal — type exit() to get out. If the prompt ends in # rather than $, you are running as root; close it and open an ordinary terminal, because nothing here needs root and working as root by habit is how accidents happen.

2
Look at what is around you

Go: same window.

Do: type ls and press Enter. Then type ls -l and press Enter.

You should see: first the names of the things in your home folder, then the same list with far more detail — permissions, owner, size and date, one item per line. -l is an option, and almost every command has some. Nothing has been changed; ls only looks.

If not: if nothing at all prints, the folder is genuinely empty — that is an answer, not an error. Blank output meaning "none" is a Unix habit you will meet constantly, and it is why commands stay silent when they succeed.

3
Make a practice folder and go into it

Go: same window.

Do: run these three commands, one at a time.

mkdir practice
cd practice
pwd

You should see: nothing from the first two — silence means success — and then a path ending in /practice. Your prompt very likely changed too, to show the folder you are now in. You have moved.

If not: mkdir: cannot create directory 'practice': File exists means you already made it, which is harmless — just cd practice. Everything from here happens inside this folder, and you can delete the whole thing at the end with one command.

4
Create some files and look at them properly

Go: stay in practice.

Do: run these three commands.

touch notes.txt report.pdf
ls
ls -l

You should see: notes.txt and report.pdf, then a detailed listing where each line begins -rw- and shows the owner and group (on a personal machine both are usually your own username) and a size of 0. touch made two empty files — one command, two files, because most commands happily take several names at once.

If not: if you see only one file, you missed the space between the two names. Spaces are how the terminal separates arguments, which is also why a filename containing a space needs quotes: touch "my notes.txt".

5
Get two errors on purpose and learn to read them

Go: stay where you are.

Do: run cd nosuchdir, then run lss. Both are meant to fail.

You should see: bash: cd: nosuchdir: No such file or directory, then bash: lss: command not found. Read the shape: the program's name, then what it could not do. The first says the place does not exist; the second says the command does not exist — almost always a typo.

If not: if cd nosuchdir succeeds, a folder by that name really is there. Neither error changed anything or broke anything, and that is worth internalising early: the terminal refusing to do something is the ordinary way it talks to you, not a sign you have damaged your computer.

6
Go back home, and tidy up

Go: stay in the terminal.

Do: type cd on its own and press Enter, then pwd. When you have finished with the practice folder, remove it with rm -r practice.

You should see: cd with nothing after it returns you to your home folder, which pwd confirms. That is the reliable way back whenever you get lost.

If not: before running rm -r, run pwd and read it. rm -r deletes a folder and everything inside it, immediately, with no confirmation and no recycle bin. Delete by an exact name you have just checked, never with a wildcard you have not tested — and if you want to keep the folder for the next tutorial, simply skip this part.

🎉
Check yourself before moving on

Without scrolling up: you run a command and nothing at all is printed. Did it work? Answer: almost certainly yes. Most Unix commands say nothing when they succeed and speak only when something goes wrong. Silence is the good outcome.

Now do it without the page: make a folder called photos inside your home folder, create three empty files in it with one command, list them in detail, then return home. Steps 3, 4 and 6 joined up, with no help.

Summary

In this tutorial, you learned:

  • What the terminal is and why it's important
  • How to open the terminal using keyboard shortcuts and the application menu
  • How to read the terminal prompt
  • Your first command: whoami
  • Essential tips for working in the terminal
🎉
Congratulations!

You've taken your first step into the world of Linux command line. In the next tutorial, you'll learn how to navigate the file system using commands like cd, pwd, and ls.