This is probably really easy and I just can't seem to find it.

I'm moving binaries around between /usr/bin and /usr/sbin, and even though both folders are in my $PATH, moving one binary to the other causes the system to continuously look for it in its original place.

Anyone know why this is, and if there is a command to refresh it?

  • 1
    have you tried the rehash command ?
    – Archemar
    Dec 23, 2014 at 19:46
  • 1
    which shell are you using?
    – faker
    Dec 23, 2014 at 19:50
  • I'm using Bash - the answer is below, the "hash -r" command. I didn't know about it.
    – Locane
    Dec 23, 2014 at 22:57

1 Answer 1


For bash

hash -r

should cause the shell to forget about the remembered locations.

  • Oh my god I knew it was easy. I've never heard of the hash command - thank you JasonAzze!
    – Locane
    Dec 23, 2014 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.