0Pricing
Linux Command Line Mastery · Lesson

Basic Navigation: `cd`, `ls`, `pwd`

Learn to move around the file system, list directory contents, and identify your current location.

Basic Navigation: `cd`, `ls`, `pwd` is a free Linux Command Line Mastery lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Linux Command Line Mastery learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Navigating Your Linux System

The Linux file system is a tree rooted at /. This lesson covers the commands to move around it and see what’s inside each directory.

Where Am I? The `pwd` Command

Lost your place? pwd (print working directory) shows the full path of where you are right now — your “you are here” sign.

See Your Current Path with `pwd`

Run pwd to see your current directory — likely something like /home/user.

pwd

What's Here? The `ls` Command

ls (list) shows the files and folders in your current directory — or any directory you point it at.

Listing Directory Contents with `ls`

Let’s make a folder and a file, then run ls to watch them show up.

mkdir my_documents
touch notes.txt
ls

Moving Around: The `cd` Command

cd (change directory) moves you around the file system. Give it an absolute path (from /) or a relative one (from where you are).

Changing with Absolute Paths

An absolute path starts at the root /, so it always points to the same place no matter where you currently are.

mkdir -p /tmp/my_project/src
cd /tmp/my_project/src
pwd

Changing with Relative Paths

A relative path starts from your current spot — shorter and handy. Use . for here and .. for the parent directory.

mkdir -p project/images
cd project
pwd
cd images
pwd
cd ..
pwd

Useful `ls` Options: `-l` and `-a`

Two essential ls flags: -l for a long listing (permissions, size, date) and -a to reveal hidden dotfiles.

touch .config_file
touch public_file
ls -a
ls -l

Test Your Navigation Skills

Consider the following sequence of commands executed in a terminal:

mkdir my_app
cd my_app
mkdir assets
touch assets/image.png
cd ..
ls

Recap: Navigate Like a Pro!

Navigation locked in! pwd shows where you are, ls lists contents, and cd moves you around with absolute or relative paths.

Frequently asked questions

Is the “Basic Navigation: `cd`, `ls`, `pwd`” lesson free?

Yes — the full text of “Basic Navigation: `cd`, `ls`, `pwd`” is free to read here on the web, and the Linux Command Line Mastery course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Linux Command Line Mastery course, upgrade to CoddyKit PRO.

What will I learn in “Basic Navigation: `cd`, `ls`, `pwd`”?

Learn to move around the file system, list directory contents, and identify your current location. You practise Linux Command Line Mastery with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Linux Command Line Mastery?

No prior experience is required. Linux Command Line Mastery on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Basic Navigation: `cd`, `ls`, `pwd`” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Linux Command Line Mastery lesson?

Yes. Every Linux Command Line Mastery lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Introduction to the Linux Shell
  2. Basic Navigation: `cd`, `ls`, `pwd`
  3. File & Directory Management: `mkdir`, `rm`, `cp`, `mv`
  4. Getting Help: man, --help, and tldr
← Back to Linux Command Line Mastery