Section 1 · Linux & the shell

Meet the command line

Linux is the operating system that runs most of the world's servers. You control it by typing commands into a shell (the program that reads your commands — usually bash). Let's decode the prompt and run your first commands.

1Reading the prompt

Before you type anything, the shell shows a prompt. It's packed with information:

anatomy of the prompt
[student@rhel9 ~]$
 └─┬──┘ └─┬─┘ └┬┘└┬┘
   │      │    │  └─ $ = normal user   (# = root/superuser)
   │      │    └──── current directory (~ means your home)
   │      └───────── hostname of the machine
   └──────────────── the user you are logged in as
$ vs # A $ at the end means you're a normal user. A # means you're root — the all-powerful administrator, where a typo can wipe the system. We'll mostly stay a normal user and use sudo only when we need power.

2Your first three commands

Run these in the terminal below — type each and press Enter:

student@rhel9: ~ — bash
now try: ls · ls -l · hostname · date

3Commands, options & arguments

Almost every command follows the same shape:

command -options arguments
ls   -l   /etc
│    │    └── argument: what to act on (here, the /etc directory)
│    └─────── option/flag: changes behaviour (-l = long, detailed view)
└──────────── the command itself

Options usually start with - (short, like -l) or -- (long, like --all). You can combine short options: ls -la is -l plus -a.

student@rhel9: ~ — bash
-a reveals hidden files (names starting with a dot, like .bashrc)

4Survival skills

TrickWhat it does
/ Scroll through commands you already typed (history). Try it above!
clearWipe the screen clean.
historyShow every command you've run this session.
man lsOpen the manual for a command (here in short form).
uname -aShow the kernel & OS — proof you're on Linux.
Case & spelling matter Linux is case-sensitive: ls works, LS does not. Notes.txt and notes.txt are two different files. Type carefully.

🧠Checkpoint

🧠

Quick check

1. Which command shows which directory you're currently in?
pwd = print working directory.
2. A prompt ending in # means you are…
# = root. Be careful — root can change or delete anything.
3. ls -la is…
Short options combine: -la = long listing + show all (hidden) files.
🔓 You're reading a free chapter of Linux Admin — the first two are open.
Unlock the rest of this course with a one-time payment.
Unlock this course →
🔓 See course prices