LAB-NAV-02 - Paths, Symbols & Tab Completion

Master absolute vs relative paths, decode Linux symbols (., .., ~), and use Tab completion to reduce mistakes and effort.

NAV Navigation Mastery

Paths, Symbols & Tab Completion

Master absolute vs relative paths, decode Linux symbols (., .., ~), and use Tab completion to reduce mistakes and effort.

45 min BEGINNER LINUX
What success looks like
  • Master absolute vs relative paths, decode Linux symbols (., .., ~), and use Tab completion to reduce mistakes and effort.
  • Repeat the workflow without copy-paste or step-by-step prompting.
Safety notes
  • Use only safe practice paths so a wrong `cd` or wildcard does not land you in a real system directory.

Part A: The Field Guide


What and Why

Navigation gets easier once you stop treating every path as a fresh string to memorize.

Paths follow a few consistent rules. Learn those rules and the terminal becomes much less fragile.


The Core Distinction

Absolute paths

Absolute paths start from the top.

Examples:

  • /var/log
  • /etc/passwd

Relative paths

Relative paths start from where you are now.

Examples:

  • Documents
  • ../Downloads

The golden rule

If a Linux path starts with /, it is absolute. If it does not, it is relative.


The Three Symbols You Need

..

Go up one level.

.

Means the current location.

~

Means your home directory.

Symbols in Use

pwd cd .. cd ~ ./script.sh


Tab Completion

Tab completion is not a luxury feature. It is an error-reduction tool.

Use it because it helps you:

  • type less
  • catch wrong folder names earlier
  • learn real path names faster

If nothing completes, pause and check spelling or location.


Common Beginner Failure Points

These show up constantly:

  • using a relative path from the wrong starting place
  • confusing / with ~
  • forgetting that ./script.sh means "run the script in this directory"
  • ignoring Tab completion and making avoidable typos

Part B: The Drill Deck

Terminal Required: Use your Linux terminal for these exercises.


G
Guided Step by step - type exactly this and compare the result
>

Exercise G1: Absolute versus relative

  1. Run cd /tmp.
  2. Run pwd.
  3. Try cd var and notice why it fails.
  4. Run cd /var and notice why it works.
  5. Run cd log and confirm where you landed.

Exercise G2: Use the symbols

  1. From /var/log, run cd ...
  2. Run pwd.
  3. Run cd ~.
  4. Run pwd.
  5. Explain the difference between .. and ~.

Exercise G3: Try Tab completion

  1. Start at /.
  2. Type cd u and press Tab.
  3. Continue into /usr and one subdirectory using Tab completion as much as possible.
  4. If completion does nothing, stop and inspect why.
S
Solo Task described, hints available - figure it out
>

Exercise S1: Absolute jumps

Use only absolute paths to visit:

  1. /etc
  2. /var/log
  3. /usr
  4. /tmp

Verify each with pwd.

Exercise S2: Relative crawling

Start in /usr/share and reach /usr and then /tmp using relative movement and .. where appropriate.

Exercise S3: Home shortcuts

From /var/log, do all three:

  1. list the contents of your home directory without moving there
  2. jump to your home directory
  3. jump back to the previous directory if your shell supports cd -
M
Mission Real scenario - no hints, combine multiple skills
>

Mission M1: Minimal typing

Pick a deep directory that exists on your machine, such as /usr/share or /var/log.

Navigate there using Tab completion as much as possible. The goal is to reduce typing errors, not to win a speed contest.

Mission M2: Explain the path, not just the command

For each of these, explain why it works before you run it:

  1. cd /var/log
  2. cd ..
  3. cd ~
  4. ./script.sh

If you can explain the rule behind each one, you understand more than just the syntax.

What to do next

Best next step Learning

Return to the related lesson if you want the concept explained more deeply.

Open now