Which ctags shows / usr / local / bin / ctags, but when I run ctags, it runs / usr / bin / ctags. How is this possible?

Please see terminal session output

sharpair:~$ /usr/bin/ctags usage: ctags [-BFadtuwvx] [-f tagsfile] file ... sharpair:~$ /usr/local/bin/ctags ctags: No files specified. Try "ctags --help". sharpair:~$ which ctags /usr/local/bin/ctags sharpair:~$ ctags usage: ctags [-BFadtuwvx] [-f tagsfile] file ... sharpair:~$ 

Note that I run ctags without an absolute path, the output is the same as if I ran / usr / bin / ctags. However, which ctags detect / usr / local / bin / ctags, which is the correct version, I would expect it to start ctags without an absolute path.

I have no aliases. How to fix this problem? Thanks!

+3
source share
1 answer

bash caches the location of ctags .

 hash -d ctags 

See help hash more details.

+10
source

All Articles