0

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?

1 Answer 1

3

You can use command cd for instance

1
  • 3
    or builtin cd Commented Jul 25, 2020 at 21:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .