L-002

File Navigation

← Script House
student@hexworth:~
Welcome to Hexworth Linux Lab L-002: File Navigation!
Learn to navigate the Linux filesystem like a pro.
Type help for available commands.
student@hexworth:~$

Current Task

1
2
3
4

Find Your Location

Use the pwd command to see your current working directory.

$ pwd

Learning Guide

The Linux Filesystem

Linux organizes files in a tree structure starting from / (root). Unlike Windows drive letters, everything branches from this single point.

/ ├── home/ # User directories ├── etc/ # Configuration files ├── var/ # Variable data (logs) ├── usr/ # User programs └── tmp/ # Temporary files

Command: pwd

Print Working Directory - shows where you currently are in the filesystem.

$ pwd
/home/student

Command: ls

List directory contents. Add flags for more detail:

$ ls
Documents Downloads scripts
$ ls -la
drwxr-xr-x student Documents/ -rw-r--r-- student .bashrc

-l = long format, -a = show hidden files (starting with .)

Command: cd

Change Directory - move to a different location.

$ cd Documents
(no output = success)

Special shortcuts:

  • cd ~ - Go to home directory
  • cd .. - Go up one level
  • cd - - Go to previous directory
  • cd / - Go to root directory
Pro Tip:

Use Tab to auto-complete directory names. Type cd Doc then press Tab!

Paths Explained

Absolute path: Starts from root (/home/student/Documents)

Relative path: Starts from current location (Documents or ./Documents)

← Filesystem Navigator Directory Reference →