Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In Unix, how can I find the correct path to an executable file?

Several Unix dialects use the whereis command to find where programs, or executables, are stored in the file structure of the computer. To use it at the Unix prompt, enter:

whereis command

Replace 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 lpr

The whereis command will return something like the following:

lpr: /usr/ucb/lpr /usr/man/man1/lpr.1

In this example, the query asked about the lpr command, 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 the lpr manual page.

To find the path the operating system uses to execute a command when you enter it on the command line, use the which command instead, for example:

which lpr

This command will output something like the following:

/var/bsd/lpr

This means that when you enter lpr at the command line, the system is really executing /var/bsd/lpr.

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 domain all.
Last modified on August 22, 2008.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.