I have 2 versions of curl installed on my system, one with http2 support.
I thought I could use which
to point to the binary, but it doesn't seem to work the way I expect.
$ curl --http2 -I https://something.example.com
curl: (1) Unsupported protocol
$ which curl
/usr/local/bin/curl
$ /usr/local/bin/curl --http2 -I https://something.example.com
HTTP/2 200
server: nginx/1.10.0 (Ubuntu)
date: Thu, 08 Jun 2017 20:55:09 GMT
content-length: 928
last-modified: Thu, 08 Jun 2017 19:43:10 GMT
cache-control: public, max-age=31536000
accept-ranges: bytes
which
is pointing to my locally built binary /usr/local/bin/curl
but the actual command is executing the package binary /usr/bin/curl
I don't have an alias for curl, so can someone please explain to me why this is so? And what command should I run to find the actual path to curl, which I happen to know is /usr/bin/curl
type curl
say? it may be hashed by the shellcurl is hashed (/usr/bin/curl)
so does that mean it takes precedence over thePATH
?hash -r curl
to "forget" the hashed location, after which the order in yourPATH
will be respected