World's most basic Unix/Linux question.
I've been scouring my $60 "Unix System Administration Handbook (3rd ed)," read the Linux and Debian FAQs, rooted around in the bash documentation, Googled and Google Groupd, and still can't figure this out:
How do I view and edit the default paths used on a systemwide basis to locate binaries?
For example, to use grep you just type "grep pattern file", not "/bin/grep pattern file". I want to do that with apachectl, which is in /usr/local/apache2/bin. What is the definitive method of controlling this, and the best practice for actually doing it?
I know about individual .bashrc files, but in some cases I want systemwide program aliases.
Thanks for any help!
7 Replies
You could also make up a file describing a path, and have everybody's .bashrc refer to that file. That's a pretty good simulation of a systemwide path.
In simple terms, if a programs name can simply be typed in at the command line (such as grep rather than /bin/grep) - it is usually because it is in a ./bin directory (such as /bin, /usr/local/bin), or some directory that is in the PATH variable. – if you want the same feature for programs which are in strange directories (such as that of /usr/local/apache2/bin/apachectl), then your best bet is probably to simply create a symbolic link to this executable in your /usr/local/bin directory, for example in your case:
ln -s /usr/local/apache2/bin/apachectl /usr/local/bin/apachectl
this will enable you to simply type 'apachectl' at the command line to execute the command.
Forgive me if this is not what you are asking - I'm very tired hehe… but it seems a simple solution to your problem
Thanks,
Shaun
Something must be setting $PATH, right??
Thanks for the link suggestion, that seems to be working well! /usr/local/bin seems like the appropriate place. If mysql can dump a bunch of random scripts in there, so can I! ;->