Next
/
Previous
/ Index
/ TCC Help System
/ Publications
/ Site map
/ NM Tech homepage
How Unix searches for commands
|
|
When you type a command, Unix looks in all the directories in
your search path for executable files whose
name matches the command you typed.
- To find out what directories are in your search path, type:
echo $PATH
The directories are listed in the order they are searched, first to
last.
- To change your search path, it is necessary to edit the file
that sets up the configuration of your shell (for example, file
.bashrc if you use bash as your shell).
See the man page for your shell for further details.
- You can find out the exact path to any command by typing:
which foo
where foo is the name of the command. For example,
which bash
might produce the output
/usr/ucb/bash
Next: Controlling multiple processes
See also: Unix fundamentals
Previous: How to organize large collections of files
Site map
Index:
Keyword index
to help pages
Help:
New Mexico Tech Computer Center: Help System
TCC Publications
Home:
About New Mexico Tech
John Shipman, john@nmt.edu
Last updated: 2000/07/29 00:46:34 UT
URL: http://www.nmt.edu/tcc/help/unix/searchpath.html