Skip to content

Linux cd Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux cd Guide

Complete beginner-friendly guide to cd on Linux, covering Arch Linux, CachyOS, and other distributions including changing directories, navigation, and directory shortcuts.


Table of Contents

  1. Understanding cd
  2. cd Basics
  3. Directory Shortcuts
  4. Navigation Tips
  5. Troubleshooting

Understanding cd

What is cd?

cd (change directory) changes current directory.

Uses:

  • Navigate: Move between directories
  • Change location: Switch directories
  • File operations: Work in different directories
  • System navigation: Explore filesystem

Why it matters:

  • Essential command: Most used command
  • Navigation: Move around system
  • File management: Access different locations

cd Basics

Change Directory

Basic usage:

# Change to directory
cd /path/to/directory

# Change to home
cd ~

# Or
cd

Relative Paths

Relative navigation:

# Parent directory
cd ..

# Current directory
cd .

# Subdirectory
cd subdirectory

Directory Shortcuts

Home Directory

Go home:

# Home directory
cd ~

# Or
cd $HOME

# Or just
cd

Previous Directory

Go back:

# Previous directory
cd -

# Returns to last directory

Navigation Tips

Absolute vs Relative

Path types:

# Absolute path
cd /home/username/documents

# Relative path
cd documents

# From current directory

Tab Completion

Auto-complete:

# Type part of name
cd doc<Tab>

# Auto-completes to documents/

Troubleshooting

Directory Not Found

Check path:

# Verify directory exists
ls -la /path/to/directory

# Check current location
pwd

# List contents
ls

Summary

This guide covered cd usage, directory navigation, and shortcuts for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally