Package: hichFile
Basic Operation:This is a combination of thewhichandfilecommands. It will
follow symlinks, reporting each link on the way, and then uselibmagicto tell you what type of file it is. If you happen to be
usingBASH, this commands offers some of the same features as thetypecommand, only prettier. Also,findfuncis installed so
any bash functions that are found will be syntax highlighted. Onapt-based systems it will use theCommandNotFoundmodule to show
installable packages for missing commands.Example:Determine whererloginis linked, and what type of file it is:whichfile rloginOutput:/usr/bin/rlogin:
    -> /etc/alternatives/rlogin
        -> /usr/bin/slogin
            -> /usr/bin/ssh
                Type: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=2d691144f816b05319ba27679df4b847107b99d7, strippedThis means thatrloginlinks to/etc/alternatives/rlogin, which
links toslogin, and finallyssh.Extended operation for BASH users:If an executable binary can’t be found, it will look for an
alias/function in~/bash.alias.shor~/.bash_aliases.Example:Determine whetherllis a BASH function or alias:whichfile llOutput:/home/cj/bash.alias.sh:
    -> ll
        -> alias ll="ls -alh --group-directories-first --color=always" # Long list dirThis means thatllis an alias in~/bash.alias.sh.Extended operation for CommandNotFound-enabled systems:If all of that fails, and you haveCommandNotFoundinstalled
(pre-installed on debian-based machines) it will look for a package
containing the executable, and suggest install instructions.Example:Determine whethermessis an installed executable:whichfile messOutput:There were errors resolving 1 path, 1 is installable.

    The program 'mess' is currently not installed.
        You can install it by typing: sudo apt install messThis means that themessexecutable cannot be found, but is
installable through themesspackage.Options:Usage:
    whichfile -h | -p | -v
    whichfile PATH... [-b | -B] [-c] [-D] [-N] [-s]
    whichfile PATH... [-d | -m] [-c] [-D] [-N] [-s]

Options:
    PATH             : Directory path or paths to resolve.
    -b,--builtins    : Only show builtins when another binary exists.
    -B,--nobuiltins  : Don't check BASH builtins.
    -c,--ignorecwd   : Ignore files in the CWD, and try $PATH instead.
    -d,--dir         : Print the parent directory of the final target.
                       This enables --nobuiltins.
    -D,--debug       : Print some debugging info.
    -h,--help        : Show this help message.
    -m,--mime        : Show mime type instead of human readable form.
                       This enables --nobuiltins.
    -N,--debugname   : Shows bash alias/function lines that don't match
                       a function/alias pattern, but were found in the
                       line. This is for debugging `whichfile` itself.
    -p,--path        : List directories in $PATH, like:
                       echo "$PATH" | tr ':' '\n'
    -s,--short       : Short output, print only the target.
                       On error nothing is printed and non-zero is
                       returned.
                       Broken symlinks will be prepended with 'dead:'.
    -v,--version     : Show version.Installation:Pip:whichfileis a PyPi package, and can be installed with pip:pipinstallwhichfileThis will create awhichfileexecutable that you can run.Git:You can also clone the repo and do a manual install:gitclonehttps://github.com/welbornprod/whichfile.gitcdwhichfilepython3setup.pyinstall--userDemo:This is a recording of several runs, showing WhichFile’s output for the
various types it can handle. Error output was included to show how
installableaptpackages are handled.