📂

Essential Guide to Bash Navigation

Jun 2, 2025

Bash Navigation Basics

Navigating Directories

  • Current Working Directory

    • Use pwd (Print Working Directory) to display the current directory path.
    • Example path: /home/Cindy/desktop.
  • Change Directory Command (cd)

    • Absolute Path: Navigate to a directory using the full path.
      • Example: cd /home/Cindy/documents.
    • Relative Path: Navigate using a path relative to the current directory.
      • Example: cd ../documents goes up one level, then into "documents".
    • Home Directory Shortcut: Use ~ (tilde) to reference the home directory.
      • Example: cd ~/desktop to go to the desktop from any location.

Tab Completion

  • Feature: Helps in auto-completing directory and file names.
    • In Bash, pressing the Tab key will show all possible options if there's more than one match.
    • Differentiates from Windows as it does not cycle but lists all options.

Connecting Windows and Linux Commands

  • The cd command and directory navigation concepts are similar in both Windows (PowerShell) and Linux (Bash).
  • Understanding these similarities helps bridge skills between Windows and Linux environments.

Notes

  • Reinforce understanding of directory navigation using absolute and relative paths.
  • Practice using tab completion to improve efficiency in command-line navigation.

This guide is a practical overview for users transitioning between Windows and Linux command-line interfaces, focusing on navigation commands.