1

I installed a new executable into /usr/local/bin and this directory is in my path ahead of /usr/bin . But, bash still prefers the version in /usr/bin until I start a new bash process. The which command clearly sees that the preferred version is in /usr/local/bin.

Bash must be caching executable file locations. Is it possible to refresh it to now see the new version in /usr/local/bin without having to restart bash?

0

1 Answer 1

3

This Unix & Linux answer is relevant:

bash does cache the full path to a command. You can verify that the command you are trying to execute is hashed with the type command:

$ type svnsync
svnsync is hashed (/usr/local/bin/svnsync)

To clear the entire cache:

$ hash -r

Or just one entry:

$ hash -d svnsync

For additional information, consult help hash and man bash.

You must log in to answer this question.

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