In server administration, backend management, and cloud architecture deployment, moving between folder structures cleanly is a daily requirement. The cd command stands for Change Directory. It is the primary terminal utility used to navigate across the directory tree of a Linux-based operating system.
By passing explicit arguments to this utility, you can shift your terminal context to any folder on the server, allowing you to execute scripts, manage files, or audit application code bases in the correct directory.
Table of Contents
Direct Navigational Patterns
The cd command handles folder shifts using two distinct pathing models based on your destination:
1. Relative Path Navigation (Subdirectory Access)
When you want to step into a folder that sits directly inside your current location, you do not need to type out the entire system path. You simply pass the immediate target folder name.
- The Scenario: Imagine you run a
pwdcheck and see you are currently positioned inside the folder path/home/mybox/yourlogin/page.com/public_html. - The Action: Since
wp-contentlives directly inside your currentpublic_htmlworkspace, you open it by executing:Bashcd wp-content
2. Absolute Path Navigation (Cross-Directory Jumps)
When you need to jump to a completely separate branch of the server filesystem, you must pass the exact absolute path starting from the system root (/).
- The Scenario: You want to jump from your current workspace straight into a completely different website directory located at
/home/mybox/yourlogin/yourpage.com/public_html. - The Action: Execute the command with the full leading path string:Bash
cd /home/mybox/yourlogin/yourpage.com/public_html
3. Traversal Navigation (Using the Two-Dot Operator)
If you are shifting between folders that share a nearby parent directory, you can use the double-dot (..) relative symbol to tell the terminal to step backward out of your current folder.
- The Action: Instead of typing out the long absolute path in the scenario above, you can step up out of
public_htmlandwebsite.com, then go down into your alternative project folder like this:Bashcd ../../yourwebsite.com/public_html
Essential Navigation Shortcuts
The Linux shell includes built-in shortcuts to speed up your terminal navigation and help you move between folders with fewer keystrokes:
cd ..(with a space and two dots) steps your terminal exactly one level up into the immediate parent folder of your current directory.cd(executed completely alone with no arguments) acts as an instant return shortcut, dropping you straight back into your user account’s primary home directory root.cd -(with a space and a single dash) functions like a back button, returning you instantly to the previous directory you were working in right before your last folder change.
The Case-Sensitivity Rule
The Linux shell is strictly case-sensitive. This means the system treats
wp-content,WP-Content, andWP-CONTENTas three entirely separate folders. You must type out every directory name exactly as it appears in the file system to avoid “No such file or directory” errors.