7 ms·
Personally I put the following in my .bashrc: function pushcd { if [ $# -eq 0 ]; then pushd ~ > /dev/null else push
by grn 14y ago
Personally I put the following in my .bashrc:
function pushcd {
if [ $# -eq 0 ]; then
pushd ~ > /dev/null
else
pushd "$@" > /dev/null
fi
}
alias cd='pushcd'
alias b='popd > /dev/null'
Then cd saves the history of visited directories and b navigates backwards, e.g.:
~$ cd /tmp
/tmp$ cd /usr
/usr$ b
/tmp$ b
~$