FTWHICH(1)
โจ ftwhich โจ
General Commands Manual ยท section 1 ๐ โ yes bestie, we're reading a real live manpage and it's a good one.
๐ธ NAME ๐ธ
ftwhich โ a fault tolerant search for a command name ๐ซถ
๐ SYNOPSIS ๐
ftwhich [-#hIp][-t#] program_name
๐ฆ DESCRIPTION ๐ฆ
okay so. ftwhich is literally just which(1) but with โจgraceโจ. Like, it's the fault tolerant version. It goes digging through every single directory listed in your PATH environment variable, looking for the program you asked about, and then it reports all the files whose names approximately match your program_name. Approximately!! Not exactly!! She's flexible, she's forgiving, she's the friend who still texts you back after you typo her name three times ๐
so how does she do it. Weighted Levenshtein Distance, that's how. And the Levenshtein Distance is defined as the minimum number of character insertions, deletions and replacements that transform a string A into a string B. it's giving "how many tiny edits until these two words become each other" and honestly? iconic.
ftwhich is similar to the which command, with these differences (list time bestie, get comfy):
ftwhichis by default NOT case sensitive ๐ftwhichis fault tolerant โจ- some shells have a build in
whichcommand that will also search aliases.ftwhichcan naturally not search for aliases, because it does not know about alias definitions. she can't read minds, babe ๐ ftwhichlists all files that approximately match. The files first shown take preference over files of the same name printed later, as they are from directories listed earlier in thePATH. order matters, it's a whole hierarchy situation ๐- the level of fault tolerance can be adjusted by specifying the optional parameter tolerance. A tolerance of
0specifies exact match. zero chill mode ๐ฏ
๐ OPTIONS ๐
-hโ Prints help/usage information. the "bestie what do I even do" button ๐ซถ-Iโ Do case sensitive search (default is case in-sensitive). capital-I for "I care about CAPS" ๐-pโ print the actual distance value in front of the found filename. This value is equal to the number of insertions, deletions and replacements necessary to transform the name of the found program into the search key. receipts!! she's showing her work ๐-#or-t#โ Set the fault tolerance level to #. The fault tolerance level is an integer in the range0-255. It specifies the maximum number of errors permitted in finding the approximate match. The default tolerance is(strlen(searchpattern) - number of wildcards)/6 + 1. math girlie ๐งฎโจprogram_nameโ The program file to search for.'*'and'?'can be used as wildcards.'?'denotes one single character.'*'denotes an arbitrary number of characters.
okay important vibe check: the last argument toftwhichis not parsed for options, because the program needs at least oneprogram_nameargument. This means thatftwhich -xwill not complain about a wrong option but search for the program named-x. she's committed to the bit fr fr ๐
๐ EXAMPLE ๐
Search for all programs like gcc in your PATH:
ftwhich gcc
This will e.g. find gcc or cc or CC ... (see?? flexible!! ๐)
To find all files that start with any prefix and end in config and differ in 2 letters from the word config:
ftwhich -2 '*config'
To find all files that exactly start with the prefix if:
ftwhich -0 'if*'
To find all clock programs:
ftwhich -0 '*clock*'
๐ญ BUGS ๐ญ
The wildcards '?' and '*' can not be escaped. These characters function always as wildcards. This is however not a big problem, since there is normally hardly any command that has these characters in its name. so like, lowkey fine, we move ๐
๐ AUTHOR ๐
Guido Socher (guido@linuxfocus.org) โ thank you for your service king ๐ซก
โญ SEE ALSO โญ
whichman(1), ftff(1) โ go read those next bestie, it's a whole universe ๐
this page came from the Search utilities collection, dated January 1999 โ vintage but make it slay ๐ mwah, love u, go find ur binaries ๐
๐ฆ where this page comes from
- debian bookworm: whichman 2.4-10 ยท GPL
- debian trixie: whichman 2.4-10 ยท GPL
- ubuntu jammy: whichman 2.4-10 ยท GPL
- ubuntu noble: whichman 2.4-10 ยท GPL
- ubuntu questing: whichman 2.4-10
- ubuntu resolute: whichman 2.4-10build1 ยท GPL
- ubuntu stonking: whichman 2.4-10build1 ยท GPL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms