which ctags shows /usr/local/bin/ctags but when I run ctags it runs /usr/bin/ctags. How is this possible?
Asked Answered
Z

1

3

Please see output from my terminal session

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:~$ 

Notice when I run ctags without absolute path, the output is the same as if I ran /usr/bin/ctags. However which ctags finds /usr/local/bin/ctags which is the right version I would expect when I run ctags without absolute path.

I have no aliases defined. How do I troubleshoot this? Thanks!

Zucchetto answered 29/8, 2011 at 3:11 Comment(2)
Symlink? Hardlink? If it's the same ctags, what's the problem?Baptism
It isn't the same ctags. Their outputs are different when I hit them with absolute paths. See terminal transcript in question.Zucchetto
F
10

bash has cached the location of ctags.

hash -d ctags

See help hash for details.

Finke answered 29/8, 2011 at 3:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.