Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application (Exuberant Ctags) installed in /usr/bin.

I have also compiled Emacs from source, which installs its own version of ctags in /usr/local/bin.

Running ctags from the command prompt runs the Emacs version from /usr/local/bin.

Is there a way to force it use the application from /usr/bin?

I can go into /usr/local/bin and delete or rename the unwanted ctags version, but I am wondering if there is another way.

share|improve this question
up vote 9 down vote accepted

Edit your PATH, so /usr/bin appears before /usr/local/bin. You find out your current path with echo $PATH. To change this depends on your system, usually ~/.bashrc. There are questions here and on ServerFault dealing with where to find environment variables and which to use, ~/.bashrc or ~/.bash_profile :-)

If you do have software installed in /usr/local/bin/ that "overrides" what the system put in /usr/bin, you can create an alias to specify which executable to run on a per-program basis. For example with this ctags program, put this in your ~/.bashrc.

alias ctags="/usr/bin/ctags"

(though one of the SF links was about cygwin specifically, it is applicable on other platforms as well)

share|improve this answer
    
$PATH...Doh! Thanks. :| – cschol Aug 11 '09 at 4:30
    
Concise. Yet has references to basically every angle that the author would want to look at. Good post. – koenigdmj Aug 11 '09 at 5:01
3  
I think I prefer the option to set an alias to it. The whole point of /usr/local/bin is that it overrides the system defaults. – GodEater Aug 11 '09 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .