type - indicate how a command would be interpreted
Synopsis
type [OPTIONS] NAME [NAME ...]
Description
With no options, type indicates how each NAME would be interpreted if used as a command name.
The following options are available:
-
-aor--allprints all of possible definitions of the specified names. -
-sor--shortsuppresses function expansion when used with no options or with-a/--all. -
-for--no-functionssuppresses function and builtin lookup. -
-tor--typeprintsfunction,builtin, orfileifNAMEis a shell function, builtin, or disk file, respectively. -
-por--pathprints the path toNAMEifNAMEresolves to an executable file in $PATH, the path to the script containing the definition of the functionNAMEifNAMEresolves to a function loaded from a file on disk (i.e. not interactively defined at the prompt), or nothing otherwise. -
-Por--force-pathreturns the path to the executable fileNAME, presumingNAMEis found in$PATH, or nothing otherwise.--force-pathexplicitly resolves only the path to executable files in$PATH, regardless of whether$NAMEis shadowed by a function or builtin with the same name. -
-qor--quietsuppresses all output; this is useful when testing the exit status.
The -q, -p, -t and -P flags (and their long flag aliases) are mutually exclusive. Only one can be specified at a time.
Example
>_ type fg fg is a builtin
© 2019 fish-shell developers
Licensed under the GNU General Public License, version 2.
https://fishshell.com/docs/3.1/cmds/type.html