Why does not http call /usr/bin/http instead of /usr/local/bin/http? [duplicate]

Posted on

Problem :

Show my path:

echo  $PATH

Issue http command:

http  --version
bash: /usr/local/bin/http: No such file or directory

Where does http locate?

which http

Issue http command with absolute path:

/usr/bin/http  --version

Why does not http call /usr/bin/http instead of /usr/local/bin/http ?

Solution :

It could be that when your shell started /usr/local/bin/http was still present. Then something happened, the file got deleted but shell doesn’t know about it.

What you need to do is to let shell forget remembered program locations by executing:

hash -r 

to view full help of the hash command, you can do help hash

Leave a Reply

Your email address will not be published. Required fields are marked *