WHICH(1)
π 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 withwhich -- --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 π«Ά
β COPYRIGHT and LICENSE β
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
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms