This is more for my edification than a problem I'm experiencing. In my .bashrc
I've overwritten cd
with a function that runs pushd
so I can easily pop the stack without thinking about it.
cd() {
[[ -z $* ]] && cd ~ || pushd "$@" > /dev/null
}
Now suppose for some reason I want to access the original cd
command. Is that possible?
I do something similar with my code.exe
(I'm running Git Bash on Windows), where I detect if I'm running within VSCode Insiders, and if so, I alias code
to the Insiders exe. I set an alias _code
to the original code.exe path so I can access if if I want to. Can I do something similar with native shell commands that aren't executables?