The scenario:
Your path environment is similar to "/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
You have a binary in your path such as /home/user/bin/putty which you delete hoping to use the same binary further down the path such as /usr/local/bin/putty.
If you then try to run the binary putty you get:
bash: /home/user/bin/putty: No such file or directory
The only answer I have found at the moment is to launch a new terminal and bash seems to have forgotten about the old binary...
I'm open to other answers though... Update: Thanks to Chris for leaving a comment with the answer which is:
hash -r
Running man bash
and searching for hash comes up with:
"A full search of the directories in PATH is performed only if the command is not found in the hash table.... The -r option causes the shell to forget all remembered locations.
All I knew was there was a command but I couldn't get Google to spit it back at me. So hash -r will fix the issue.
hash -r