Skip to content
TURNKEYGNU / LINUX
AppsDocumentationBlogScreenshotsGitHubTurnKey Hub
Home/Blog/CDPATH

From the project

CDPATH

By Liraz Siri4 October 20151 min read
tips

I used bash for a decade or so before I discovered this little highly useful gem a few years back. Nowadays I can't remember what I used to do without it.

From the bash manual page:

CDPATH

The search path for the cd command.  This is  a  colon-separated
list of directories in which the shell looks for destination
directories specified by the cd command.

A sample value is ".:~:/usr".

I've added the following to my .bashrc:

CDPATH=.:/turnkey:/turnkey/projects:/turnkey/appliances

Now this works:

cd tklbam # takes me to /turnkey/projects/tklbam
cd core   # takes me to /turnkey/appliances/core
cd notes  # takes me to /turnkey/notes

For best results, turn on bash auto completion:

apt-get install bash-completion

Keep exploring

Find your next server

Browse ready-to-use appliances by the job you need to do.

Explore the app library
TURNKEYGNU / LINUX

Own your infrastructure without starting from scratch.

Explore TurnKey
AboutDocumentationFAQBlogGitHub
Free and open sourceSecure by defaultReady to deploy