Forrest logo
back to the whence tool

whence:tldr:7da99

whence: Search only the `PATH` for {{command}}, ignoring builtins, aliases or shell functions (equivalent to the `where` command).
$ whence -p "${command}"
try on your machine

The command "whence" is a built-in shell command in some Unix-like operating systems. It is used to display the full path of a command. Here is an explanation of the command:

  • "${command}" is a variable that holds the name of the command that we want to find its full path. The variable is enclosed in double curly braces, which is a way to reference shell variables.

  • -p is an option or flag used with the "whence" command. In this context, it stands for "print" or "show". When used with the "-p" option, "whence" will display the full path of the specified command.

So, when you run the command "whence -p "${command}"", it will find the full path of the command specified by the value stored in the "${command}" variable, and then print or display that full path on the terminal.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the whence tool