From 5ddf587e3ae8e507c707e70ba4e1904e766ef89b Mon Sep 17 00:00:00 2001 From: Daniel Bayley Date: Thu, 14 May 2020 16:04:48 +0100 Subject: [PATCH] whence: add page (#4021) --- pages/osx/whence.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/osx/whence.md diff --git a/pages/osx/whence.md b/pages/osx/whence.md new file mode 100644 index 0000000000..c1aa98f07c --- /dev/null +++ b/pages/osx/whence.md @@ -0,0 +1,23 @@ +# whence + +> A zsh builtin to indicate how a given command would be interpreted. + +- Interpret {{command}}, with expansion if defined as an `alias` (similar to the `command -v` builtin): + +`whence {{command}}` + +- Display type of {{command}}, with location if defined as a function, or binary (equivalent to the `type` and `command -V` builtins): + +`whence -v {{command}}` + +- Same as above, except display content of shell functions instead of location (equivalent to `which` builtin): + +`whence -c {{command}}` + +- Same as above, but show all occurrences on command path (equivalent to the `where` builtin): + +`whence -ca {{command}}` + +- Search only the `PATH` for {{command}}, ignoring builtins, aliases or shell functions (equivalent to the `where` command): + +`whence -p {{command}}`