which

 


 
 
 
 User Commands                                            which(1)
 
 
 


NAME

which - locate a command; display its pathname or alias

SYNOPSIS

which [ filename ... ]

DESCRIPTION

which takes a list of names and looks for the files which would be executed had these names been given as commands. Each argument is expanded if it is aliased, and searched for along the user's path. Both aliases and path are taken from the user's .cshrc file.

FILES

~/.cshrc source of aliases and path values /usr/bin/which

ATTRIBUTES

See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________|

SEE ALSO

csh(1), attributes(5)

DIAGNOSTICS

A diagnostic is given for names which are aliased to more than a single word, or if an executable file with the argu- ment name was not found in the path.

NOTES

which is not a shell built-in command; it is the UNIX com- mand, /usr/bin/which BUGS Only aliases and paths from ~/.cshrc are used; importing from the current environment is not attempted. Must be exe- cuted by csh(1), since only csh knows about aliases. To compensate for ~/.cshrc files in which aliases depend upon the prompt variable being set, which sets this variable to NULL. If the ~/.cshrc produces output or prompts for input when prompt is set, which may produce some strange results. SunOS 5.8 Last change: 26 Sep 1992 1