tldr/pages/osx/whence.md

25 lines
854 B
Markdown
Raw Normal View History

2020-05-14 16:04:48 +01:00
# whence
> A zsh builtin to indicate how a command would be interpreted.
> More information: <https://keith.github.io/xcode-man-pages/whence.1.html>.
2020-05-14 16:04:48 +01: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
- 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
- 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}}"`