Created
June 16, 2009 01:30
-
-
Save mbadran/130469 to your computer and use it in GitHub Desktop.
replace cd in bash to (silent) pushd
This file contains hidden or 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
alias cd="pushd $@ > /dev/null" |
I've been fond of tuning little things of that kind a lot, it's very exciting sometimes
the last for today - three more functions on topic from my own regular set of /etc/bash.functions
pushd () {
builtin pushd ${1} >/dev/null 2>&1
}
popd () {
builtin popd ${1} >/dev/null 2>&1
}
dirs () {
builtin dirs -v
}
respect, guys!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and one more note to catch up especially for mr. @keltroth and mr. @3v1n0
as it caught my eye, you both till the last revision leave
$OLDPWD
value unescaped, and it's quite dangerous, 'cause if the previous dir will include spaces in name - withcd -
one will definitely fail to return. and since everything in this routine is silenced with/dev/null
, it would be an adventure to find out what a hell is going on. been there, seen that