Forrest logo
back to the which tool

which:tldr:1c3e3

which: If there are multiple executables which match, display all.
$ which -a ${executable}
try on your machine

The command "which -a ${executable}" is used to locate the executable file associated with a given command or program. Here is an explanation of its components:

  • "which" is a command-line utility in Linux and Unix-like operating systems that searches for the location of executable files in the directories listed in the PATH environment variable.

  • "-a" is an option or flag for the "which" command. It enables the display of all matching executables found in the directories listed in the PATH.

  • "${executable}" is a placeholder for the name of the command or program you want to find. You need to replace it with the actual name of the executable you are searching for.

By running the "which -a ${executable}" command, the system will search for the specified executable in the directories listed in your PATH. If there are multiple matches, it will display the paths of all the matching executables.

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 which tool