02.05.2013 Views

Description - Mks.com

Description - Mks.com

Description - Mks.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NAME<br />

which, whereis<br />

which, whereis — display full path name for executable <strong>com</strong>mand<br />

SYNOPSIS<br />

which [-a] <strong>com</strong>mand ...<br />

whereis <strong>com</strong>mand ...<br />

DESCRIPTION<br />

Windows systems use the PATH environment variable to determine which directories are searched<br />

to find programs. If PATH is not found under Windows NT/2000/XP/2003, which then searches for<br />

Path. For each <strong>com</strong>mand, which looks through the directories in the search path, and displays the<br />

name of the first executable file that matches <strong>com</strong>mand.<br />

which uses the PATHEXT environment variable to determine which files are considered<br />

executable. As which searches each directory in the search path, it appends each of the<br />

extensions in the list, in turn, to <strong>com</strong>mand name to see if it matches a file name in that directory. If<br />

a match exists, that file is considered to be executable.<br />

If PATHEXT is not defined, which only considers files with a .exe, .<strong>com</strong>, .bat, or .cmd<br />

extension to be executable.<br />

Because which is intended primarily for use when working from the Windows <strong>com</strong>mand prompt, it<br />

always searches the current directory first before consulting the search path in the same way that<br />

Windows <strong>com</strong>mand interpreters (such as <strong>com</strong>mand.<strong>com</strong> and cmd.exe) do.<br />

Note:<br />

When running which from the Windows <strong>com</strong>mand prompt, not all executable files reported<br />

may be directly executable from the prompt. Such files may require the use of an additional<br />

program (such as a shell) to execute it. The program to use can normally be determined by<br />

the file's extension. For example, files with a .sh extension should be executed using the<br />

MKS KornShell.<br />

The whereis <strong>com</strong>mand is equivalent to specifying which -a.<br />

Options<br />

455 of 457

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!