Skip to content

Instantly share code, notes, and snippets.

@atdt
Created May 26, 2011 00:24
Show Gist options
  • Save atdt/992295 to your computer and use it in GitHub Desktop.
Save atdt/992295 to your computer and use it in GitHub Desktop.
ncd to cd anywhere in your home directory tree
# ncd anywhere in your home directory tree!
NCDPATH=".:`find ~ -type d | \
grep -v '\/\.' | \
awk '{ print length, $0 }' | \
sort -n | \
cut -d" " -f2- | \
tr '\n' ':'`"
alias ncd="CDPATH=$NCDPATH cd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment