Last active
December 16, 2015 01:39
-
-
Save rcmdnk/5356817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cd { | |
if [ $# = 0 ];then | |
command cd | |
elif [ "$1" = "-" ];then | |
local opwd=$OLDPWD | |
pushd . >/dev/null | |
command cd $opwd | |
elif [ -f "$1" ];then | |
pushd . >/dev/null | |
command cd $(dirname "$@") | |
else | |
pushd . >/dev/null | |
command cd "$@" | |
fi | |
} | |
alias bd="popd >/dev/null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment