Exploring cd - Linux Commands

  • #linux

What is the 'cd' Command?

The cd command, an abbreviation for change directory, holds a distinguished position as one of the most fundamental and frequently employed commands in the Linux ecosystem. It serves as the primary means for traversing the intricate directory structure of the Linux file system.


How Does it Work?

cd [Directory]

Directory represents the destination directory you want to navigate to. You can specify either an absolute path or a relative path

  • Absolute Path: An absolute path starts from the root directory ('/') and specifies the full directory hierarchy leading to the target directory.
  • Relative Path: A relative path, on the other hand, is specified relative to your current working directory.

Moving to a Specific Directory

cd ~/Documents

Common Use Cases & Shortcuts

Shortcut Description Example Target
~ Home directory Navigates to /home/user/
.. Parent directory Moves up one level
- Previous directory Toggles back to last location
/ Root directory Navigates to base / file system

Thank you

Thank you for your time and for reading this

Related but not so Related Concepts