2020-05-14 16:04:48 +01:00
|
|
|
# whence
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
> A zsh builtin to indicate how a command would be interpreted.
|
2024-01-31 10:20:27 +00:00
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/whence.1.html>.
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2023-11-12 03:08:58 +00:00
|
|
|
- Interpret `command`, with expansion if defined as an `alias` (similar to the `command -v` builtin):
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2022-02-14 11:21:43 +00:00
|
|
|
`whence "{{command}}"`
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2023-11-12 03:08:58 +00:00
|
|
|
- Display type of `command`, with location if defined as a function, or binary (equivalent to the `type` and `command -V` builtins):
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2022-02-14 11:21:43 +00:00
|
|
|
`whence -v "{{command}}"`
|
2020-05-14 16:04:48 +01:00
|
|
|
|
|
|
|
- Same as above, except display content of shell functions instead of location (equivalent to `which` builtin):
|
|
|
|
|
2022-02-14 11:21:43 +00:00
|
|
|
`whence -c "{{command}}"`
|
2020-05-14 16:04:48 +01:00
|
|
|
|
|
|
|
- Same as above, but show all occurrences on command path (equivalent to the `where` builtin):
|
|
|
|
|
2022-02-14 11:21:43 +00:00
|
|
|
`whence -ca "{{command}}"`
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2023-11-12 03:08:58 +00:00
|
|
|
- Search only the `PATH` for `command`, ignoring builtins, aliases or shell functions (equivalent to the `where` command):
|
2020-05-14 16:04:48 +01:00
|
|
|
|
2022-02-14 11:21:43 +00:00
|
|
|
`whence -p "{{command}}"`
|