4 ms·
I really love pushd/popd.
by shawkinaw 13y ago
I really love pushd/popd.
- clarry 13y agoFor OpenBSD ksh I've got this hack alias d='[ ${#DIRSTACK[@]} -gt 0 ] && for i in `jot ${#DIRSTACK[@]} 1 ${#DIRSTACK[@]} 1`; do echo ${DIRSTACK[$i-1]}; done; echo $PWD' alias popd='[ ${#DIRSTACK[@]} -gt 0 ] && { cd "${DIRSTACK[${#DIRSTACK[@]}-1]}"; unset DIRSTACK[${#DIRSTACK[@]}-1]; }; d' alias pushd='DIRSTACK[${#DIRSTACK[@]}]="$PWD"; cd'
- TomAnthony 13y agoOk, that is pretty freaking awesome. Thanks. For others who don't know it: http://en.wikipedia.org/wiki/Pushd_and_popd http://en.wikipedia.org/wiki/Pushd_and_popd. It essentially is a stack for the working directory, so you can get back to where you were previously quickly and easily.
- guard-of-terra 13y agozsh has AUTO_PUSHD, guess what it does.
- mafro 13y agojump just made it into oh-my-zsh: http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-f...