WHICH(1)

๐Ÿ“ฆ
version 5.24 ยท 2 versions
, in debian trixie, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ WHICH(1) โ€” General Commands Manual โœจ

๐Ÿ’– NAME

which - locate a command ๐Ÿ”

๐ŸŽ€ SYNOPSIS

which [-as] filename ...

๐Ÿ’… DESCRIPTION

okay so bestie, which is literally the detective of your terminal ๐Ÿ•ต๏ธโ€โ™€๏ธโœจ it tells you the pathnames of the files (or links) that would get executed in the current environment, if you gave its arguments as commands to a strictly POSIX-conformant shell. ๐Ÿซถ it does this by searching the PATH for executable files that match the names you hand it. ๐ŸŒธ

and ngl, it does not canonicalize path names, so what you see is what you get ๐Ÿ™ˆ

๐Ÿฆ‹ OPTIONS

  • -a โ€” print all matching pathnames of each argument, not just the first one ๐Ÿ‘‘
  • -s โ€” silently return 0 if all of the executables were found, or 1 otherwise ๐Ÿคซ

๐Ÿ”ฅ EXIT STATUS

  • 0 โ€” if all specified commands are found and executable โœจ slay
  • 1 โ€” if one or more specified commands is nonexistent or not executable ๐Ÿ˜ญ
  • 2 โ€” if an invalid option is specified ๐Ÿ’€

Debian ยท 29 Jun 2016 ยท WHICH(1) ๐ŸŒˆ that's the whole tea, bestie, love you ๐Ÿ’œ