Change directories really fast
#!/bin/bash | |
# | |
# Change directories really really fast | |
# | |
# Author: Justin Hileman (http://justinhileman.com) | |
# | |
# 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