> ## Content Index
> Fetch the complete content index at: https://mfitzp.ghost.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Set CDPATH to ease folder navigation
- URL: https://mfitzp.ghost.io/set-cdpath-to-ease-folder-navigation/
- Published: 2011-11-08T00:00:00.000Z
- Updated: 2023-06-25T18:15:10.000Z
- Author: Martin Fitzpatrick
- Tags: Tutorials, #Import 2024-03-14 08:20, #Import 2026-08-24 14:26

CDPATH is an environment variable which tells the `cd` command where to look for the specified folder. By including the parent folders of commonly used locations you can access folders more easily - and without typing an entire path.

Open up your shell profile file `.bashrc` (Linux) or `.bash_profile` (Mac).

Somewhere near the bottom of the file add a line to set the CDPATH environment variable:

```bash
CDPATH=:..:~:~/data:~/projects
```

The paths provided are checked in order, from left to right. The above example therefore tells `cd` to look in:

1. The current directory (blank; before the first `:`)
2. The parent directory `..`
3. Your home directory `~`
4. Your projects directory in your home `~/projects`

💡

**You can add as many folders to search as you like and these will be checked in order from left to right.*

Restart your shell (close and reopen or enter `restart`) and then try to `cd` to folders in your home directory from anywhere on your filesystem with `cd <foldername>` and no path.