Skip to content

Instantly share code, notes, and snippets.

@ryotarai
Created August 30, 2013 09: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 ryotarai/6388016 to your computer and use it in GitHub Desktop.
Save ryotarai/6388016 to your computer and use it in GitHub Desktop.
Replace cd by pushd and add bd using popd.
pushd()
{
if [ $# -eq 0 ]; then
DIR="${HOME}"
else
DIR="$1"
fi
builtin pushd "${DIR}" > /dev/null
# echo -n "DIRSTACK: "
# dirs
}
popd()
{
builtin popd > /dev/null
# echo -n "DIRSTACK: "
# dirs
}
alias cd='pushd'
alias bd='popd'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment