1which(1) User Commands which(1)
2
3
4
6 which - locate a command and display its pathname or alias
7
9 which [name]...
10
11
13 which takes a list of names and determines which alias or utility would
14 be executed had these names been given as commands.
15
16
17 For each name operand, if it names an alias the alias is expanded. Oth‐
18 erwise the user's path is searched for a utility name matching name.
19 Aliases are taken from the user's .cshrc file. path is taken from the
20 current shell execution environment.
21
23 The following operand is supported:
24
25 name The name of a command to be located.
26
27
29 The following exit values are returned:
30
31 0 Successful completion.
32
33
34 >0 One or more name operands were not located or an error occurred.
35
36
38 ~/.cshrc source of aliases and path values
39
40
42 See attributes(5) for descriptions of the following attributes:
43
44
45
46
47 ┌─────────────────────────────┬─────────────────────────────┐
48 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
49 ├─────────────────────────────┼─────────────────────────────┤
50 │Availability │SUNWcsu │
51 └─────────────────────────────┴─────────────────────────────┘
52
54 csh(1), attributes(5)
55
57 A diagnostic is given for names which are aliased to more than a single
58 word, or if an executable file with the argument name was not found in
59 the path.
60
62 The which utility is not a shell built-in command.
63
65 To compensate for ~/.cshrc files in which aliases depend upon the
66 prompt variable being set, which sets this variable to NULL. If the
67 ~/.cshrc produces output or prompts for input when prompt is set, which
68 can produce some strange results.
69
70
71
72SunOS 5.11 30 Mar 2005 which(1)