Skip to content

Instantly share code, notes, and snippets.

@atdt
Created May 26, 2011 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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