TutsFx logo

Linux Command Line Basics

The Terminal and Your First Commands

2 min read Last updated 45 minutes ago

The terminal (also called the shell, or the command line) is a text-based interface for controlling your computer. Instead of clicking, you type commands and press Enter.

Opening a terminal

  • Ubuntu / Debian: press Ctrl + Alt + T
  • macOS: press Cmd + Space, type "Terminal"
  • Any Linux: look for an app called "Terminal", "Konsole", or "xterm"

The prompt

When the terminal opens you see something like this:

bash
username@hostname:~$

This is the prompt. It is the shell's way of saying "I am ready for your command." The $ marks the end of the prompt — you type your commands after it.

  • username — the user you are logged in as
  • hostname — the name of the machine
  • ~ — your current directory. The tilde is shorthand for your home directory, e.g. /home/username
i

Not the `$`

When tutorials show $ ls -la, the $ is just the prompt symbol. You type ls -la — not the dollar sign.

Your first command: pwd

pwd stands for print working directory — it shows where you are right now:

bash
pwd

You should see your home directory:

Code
/home/username

Listing files with ls

ls lists the contents of the current directory:

bash
ls

To see hidden files (those starting with a dot, like .bashrc) and more detail:

bash
ls -la
Flag Meaning
-l Long format: permissions, owner, size, date
-a Show all files, including hidden ones
-h Human-readable sizes (1.4K instead of 1480)

Combine flags

Flags can be combined: ls -lah does exactly what ls -l -a -h does.

Try it

  1. Run pwd and note your current directory
  2. Run ls — what do you see?
  3. Run ls -la — notice the hidden files that appeared
Share:

We value your privacy

We use cookies to enhance your browsing experience, serve personalized ads, and analyze traffic. By clicking "Accept", you consent to our use of cookies. Read our Privacy Policy to learn more.