Remember that Unix systems have a hierachial directory system. The PATH 
variable tells the system (specifically the shell) where and how to search 
for commands. Additionally, Unix, unlike Mac and Windows9x, is a multi-user 
system. Each user has their own directory tree. Let's say on a large Unix 
system with hundreds or thousands of users, should the system search every 
directory in the hierarchy for a command. If the command by the same name 
appears in more than one directory, which should be found first. 

I mentioned that the PATH variable also described how the search should 
proceed (or more specifically the order):
example: BASH or KSH syntax:
export PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin:/opt/someapp/bin
In the above PATH, when the user types a command, the shell will search 
first in the user's home directory tree bin directory, then in the root 
bin, forllowed by /usr/bin, /usr/local/bin and the bin directory of some 
application. 
Note that it does not search in the user's current directory (you must add 
. (eg dot) to the PATH).
A user might also add /sbin and /usr/sbin. 
Unix and Linux have over 1000 commands installed on each system. 

Since the Mac is primarily a GUI, you don't generally execute commands at 
the command line. In older MS-DOS systems, and current Windows commands 
prompts, where you can enter commands at the command line, you tell the 
system through the PATH where those commands are. 
On 15 Apr 2002 at 18:29, Michael Bovee wrote:

> Okay, apologies in advance, but something I _just dont get_ is the 
> PATH variable.
> (I'm a born and raised Macintosh user so please bear with me)
> I bought a SAMS Teach Yourself book on Unix, but it says nothing 
> about WHY this PATH thing is even necessary.  (Under MacOS... if I 
> invoke the 'FIND' command it just looks everywhere all the time)
> 
> I just want to execute a command, or find a file, something 'simple'
> 
> For example, I tried running commands the SuSE 7.3 (for PPC) manual 
> tells me to use for configuring stuff like my PCMCIA network card and 
> all I get back is - command not found. But it HAS to be there, 
> somewhere.  Doesn't work as regular user or as root.
> 
> Why is it not the default that the system can look *everywhere*? Or 
> more to the point, why would my followed-the-rules install of SuSE 
> Linux 7.3 not be already configured to allow me to do the very things 
> the printed manual says should work?
> 
> Almost every time I try something on my own I burn up time and a new 
> set of spinning wheels without getting anywhere. :0)  As the months 
> fly by, MacOS X improves; there's now this Fink project
> http://fink.sourceforge.net
> and I'm left feeling that all the money I've put into distro software 
> and books has been for nothing...
> 
> Maybe I just need a more basic intro book?
> Maybe I should just learn OS X and go away!?  :0)
> 
> TIA, I appreciate the willingness of experts on this mailing list to 
> stoop to my level!
> --Michael
> -- 
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Michael L. Bovee, Ph.D.
> Postdoctoral Fellow
> University of Vermont
> Department of Biochemistry
> B403 Given Building
> Burlington, VT  05405-0068
> email: [EMAIL PROTECTED]
> http://biochem.uvm.edu
> Lab   802-656-0345
> FAX  802-862-8229
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> *****************************************************************
> To unsubscribe from this list, send mail to [EMAIL PROTECTED]
> with the text 'unsubscribe gnhlug' in the message body.
> *****************************************************************


--
Jerry Feldman <[EMAIL PROTECTED]>
Associate Director
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9


*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to