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)
A practical difference is in the way that the resulting shell environment reads its initial configuration settings.
/usr/bin/login forks a login shell. I think that it invokes the authentication process, but you may not see any visible authentication interaction if you're already logged in. And, of course, if your login shell is not bash, login will invoke it instead of bash.
bash is a shell that knows whether it was invoked as a login shell or not. A bash login shell reads .bash_profile or .bash_login or .profile -- only one, in that order of preference. A non-login shell will not read a .profile but will read from .bashrc. This is normal bash behavior under modern *nix platforms, but it can lead to difficult to detect weird behaviors if you don't understand what's going on.
For instance, you can open a "login" shell via Terminal, and get one set of environmental variables (say, from your .profile), then type "bash" and get a completely different set of variables (from the .bashrc, plus any variables that were exported, minus those which were not). In particular, PATH can get mangled with repeated or missing entries.
Best Answer
Wikipedia has a decent explanation. From that article:
/bin
: "Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp."/usr/bin
: "Non-essential command binaries (not needed in single user mode); for all users."