WHICH(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ’… WHICH(1) β€” the Perl one, bestie

okay so picture this: it's WHICH(1), straight out of the User Contributed Perl Documentation section, and she is here to tell you exactly where your commands live. no cap. let's get into it πŸŽ€


✨ NAME ✨

which β€” report full paths of commands. that's it. that's the whole job. she finds things. icon behavior honestly 🫢


🌸 SYNOPSIS 🌸

which [-a] filename ...

like, you give her filenames, she gives you paths. simple as. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

which prints the full paths to the commands you hand her as arguments, and she figures all that out based on the $PATH environment variable. she's literally doing a vibe check on every directory in $PATH until she finds your command.

and if the command is not found? nothing. printed. at all. silence. she just stares at you πŸ’€ (no error, no drama, just absence.)

πŸŽ€ OPTIONS πŸŽ€

which accepts the following options, and yes there are only two, she's low maintenance:

  • -a β€” print out all instances of the command on $PATH, not just the first one. like when your command is showing up in three different places and you need the receipts πŸ”₯
  • -- β€” stop parsing for options. so if you ever need to find the path to -- itself, you hit her with which -- -- and she gets it. iykyk πŸ’…

🧚 ENVIRONMENT 🧚

the environment variable $PATH (also DCL$PATH under DCL; or $Commands under MPW) is what she uses to find the list of directories to check for commands. that's her whole map, bestie πŸ—ΊοΈ

also! the variable %PATHEXT% gets examined for command extensions if it exists. if it doesn't exist, she's not gonna stress about it.


πŸ’€ BUGS πŸ’€

which has no known bugs.

read that again. no known bugs. she said flawless and meant it πŸ‘‘βœ¨


🌈 COMPATABILITY 🌈

traditionally, which also parses ones ~/.cshrc file to look for aliases, and reports the alias when applicable. this version of which does not do that β€” because there are more shells than csh, and she's not about to play favorites. periodt.

that said, which will examine aliases under MPW (Mac) and symbols under DCL (VMS). so like, context matters πŸ¦‹


πŸ’– AUTHOR πŸ’–

the Perl implementation of which was written by Abigail, perlpowertools@abigail.be. portability enhancements by Peter Prymmer. absolute legends, both of them 🫢


this program is copyright by Abigail 1999.

this program is free and open software. you may use, modify, distribute and sell this program (and any modified variants) in any way you wish β€” provided you do not restrict others to do the same. sharing is caring, don't be that person πŸ™ˆ


okay and the cute lil sign-off at the bottom of the page: this is perl v5.42.2, dated 2026-02-15, and yes she's still WHICH(1). slay, go find your commands bestie πŸ’œπŸŒΈ

πŸ“¦ where this page comes from