zsh use old binary after install new binary

I've upgraded curl from source by configure, make and sudo make install.
But, My zsh use old version binary. What the reason for this behavior?

Environment

  • CentOS Linux release 7.8.2003
  • zsh 5.3.1
  • antigen

Processes

  1. Install curl 7.75
  2. curl --version run old version(7.29)
  3. /usr/local/bin/curl --version run new version(7.75)
$ curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu)  (snip)

$ which curl
/usr/local/bin/curl

$ /usr/local/bin/curl --version
curl 7.75.0 (x86_64-pc-linux-gnu)  (snip)

If I'll write PATH environment variable without change, zsh run new version without absolute path.

$ curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu)  (snip)

$ export PATH=$PATH

$ curl --version
curl 7.75.0 (x86_64-pc-linux-gnu)  (snip)

Run the rehash command to make zsh pick up the new command location. zsh caches the locations of commands internally so that it doesn't have to traverse the $PATH every time. The rehash command refreshes that cache.