In Unix, how can I find the correct path to an executable file?
Several Unix dialects use the
to find where programs, or executables, are stored in the file
structure of the computer. To use it at the Unix prompt, enter:
command with the name of the executable for which
you are looking. For example, if you are looking for the location of
the lpr command, you would enter:
whereis command will return something like the
lpr: /usr/ucb/lpr /usr/man/man1/lpr.1
In this example, the query asked about the
which spools jobs to printers. The operating system returned two
answers, and thus two paths. The first path is the location of the
lpr executable, and the second path is the location of
lpr manual page.
To find the path the operating
system uses to execute a command when you enter it on the command line, use
which command instead, for example:
This command will output something like the following:
This means that when you enter
lpr at the command line,
the system is really executing
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
This is document acec in the Knowledge Base.
Last modified on 2016-12-06 11:11:55.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.