Skip to content

Instantly share code, notes, and snippets.

@bobthecow bobthecow/cdd.bash

Created Jun 21, 2010
What would you like to do?
Change directories really fast
# Change directories really really fast
# Author: Justin Hileman (
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.cdd.bash`) and source it in `.bashrc`
# Usage:
# `cd .....` is equivalent to `cd ../../../..`, i.e.:
# `cd ..` plus one extra dot for each parent directory you want to jump
cdd () {
cd "$(python -c "d='${1}'; print d if d.strip('.') else '.' + '/..' * (len(d) - 1) if d else '${HOME}'")"
alias 'cd'='cdd'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.