// learn ยท linux ยท rhcsa ยท 10 min

Linux command line essentials.

The shell is just a program that runs other programs. Watch commands run live in a simulated terminal โ€” six steps from 'what's that $ symbol?' to chaining commands with pipes.

Linux command line essentials animated tutorial. Shell, navigation, file operations, viewing files, redirection, and pipes. Covers RHCSA EX200 exam objectives for shell basics.
// command line essentials

A few commands and a few symbols get you 90% of what you'll need at the Linux shell every day. Watch the terminal below as you step through.

// before you start
you should know
  • ยทRoughly what a 'file' and a 'directory' (folder) are
  • ยทKnowing how to open a terminal app on your computer
  • ยทNothing else โ€” this is the on-ramp
by the end you'll

Move around the filesystem, create/copy/delete files, read files, send command output to files, and chain commands with pipes.

pace: 10 minutes

bash transcript โ€” step 1 / 6 ยท the prompt
student@laptop ~ $echo Hello
Hello
student@laptop ~ $whoami
student
student@laptop ~ $date
Sun May 24 14:32:10 UTC 2026
student@laptop ~ $

The shell and the prompt

When you open a terminal you're running a 'shell' โ€” a small program whose only job is to take a line of text from you, find the command you named, and run it. On Linux that shell is usually Bash. The $ symbol (called the prompt) means 'I'm ready for your next command'. Try typing the command name, optional flags starting with -, and arguments โ€” all separated by spaces.

// key insight

The Unix philosophy: do one thing well, and connect with pipes. Every command you learn is a building block. grep alone is useful; cat | grep | sort | uniq -c | head is engineering. Build the habit of asking "is there a command that does just this one step?"

// survival commands ยท the daily 25
$pwd
$ls / ls -la
$cd DIR / cd ..
$cd ~ / cd -
$touch FILE
$mkdir -p PATH
$cp SRC DST
$cp -r DIR DST
$mv SRC DST
$rm FILE / rm -rf DIR
$cat FILE
$less FILE
$head -N / tail -N
$tail -f FILE
$grep PATTERN FILE
$wc -l
$sort / sort -n
$uniq -c
$find PATH -name PAT
$history
$man CMD
$CMD --help
$which CMD
$Ctrl-C
$Ctrl-R, then type
// check yourself
4 quick questions
Q1

You want to change to your home directory and see what's there. Which two commands?

Q2

You want to save the output of `ls /etc` into a file called list.txt โ€” replacing whatever's already in list.txt. Which symbol?

Q3

Why does rm -rf / on Linux destroy almost everything?

Q4

What does the pipe character | do?

These aren't graded โ€” they're just for active recall, which is what actually makes the lesson stick.

๐ŸŽฎ
// now exercise it

Try the Bash Command Challenge

Reading is one thing โ€” typing the command yourself is what makes it stick. 37 challenges across Easy, Medium, and Hard. Free play, no timer required.

play โ†’

Read this lesson as text6 chapters ยท quiz answers

  1. 01The shell and the prompt

    When you open a terminal you're running a 'shell' โ€” a small program whose only job is to take a line of text from you, find the command you named, and run it. On Linux that shell is usually Bash. The $ symbol (called the prompt) means 'I'm ready for your next command'. Try typing the command name, optional flags starting with -, and arguments โ€” all separated by spaces.

  2. 02Where am I, what's here, where can I go

    Three navigation commands cover 90% of moving around. pwd prints your current directory. ls lists what's in the current directory. cd changes to another directory โ€” give it an absolute path (starting with /) or a relative one (relative to where you are now).

  3. 03Making and moving things

    Create empty files with touch. Create directories with mkdir. Copy with cp, rename or move with mv, delete with rm. rm is permanent โ€” there's no recycle bin. Use -r to recurse into directories. Use -i to make rm ask before each delete (a good habit for new users).

  4. 04Reading files

    Four commands for looking at file contents. cat prints the whole file (fine for short ones). less is a pager โ€” for long files, press space to advance, q to quit, / to search. head shows just the first lines (default 10). tail shows the last. tail -f follows the file as it grows โ€” perfect for live log viewing.

  5. 05Redirecting output

    By default a command prints to your screen (technically 'standard output'). Use > to redirect into a file (overwriting it). >> appends to a file instead. 2> redirects errors separately. 2>&1 redirects errors into the same place as normal output. < feeds a file in as the command's input. Combining these is a superpower.

  6. 06Pipes โ€” connect commands

    The pipe | takes the output of one command and feeds it as the input of the next. This is the heart of Unix: many small tools that each do one thing, chained together. Most pipelines you'll write look like 'produce some text โ†’ filter or transform it โ†’ present it'.

Quiz โ€” answers

You want to change to your home directory and see what's there. Which two commands?
โ†’cd ~ && lscd ~ goes to your home directory (~ is shorthand). Then ls lists it. cd alone (no argument) also works.
You want to save the output of ls /etc into a file called list.txt โ€” replacing whatever's already in list.txt. Which symbol?
โ†’ls /etc > list.txt> overwrites the target file with the command's output. >> appends instead. | feeds output to another command, not a file.
Why does rm -rf / on Linux destroy almost everything?
โ†’-r recurses into directories, -f forces no-confirm, and / is the root of the filesystem โ€” so it walks the whole tree and deletesThere's no recycle bin and no confirmation. This is the classic Linux foot-gun. Modern rm versions refuse / by default but the principle stands โ€” be careful.
What does the pipe character | do?
โ†’Takes one command's standard output and feeds it as another command's standard inputPipes connect tools end-to-end. It's how the Unix 'small tools' philosophy becomes a productivity multiplier.
// more in linux

keep going โ€” these pair well with what you just learned.

see all linux โ†’

See also

back to RHCSA trackall lessons