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- --typeprints- function,- builtin, or- fileif- NAMEis a shell function, builtin, or disk file, respectively.
- -por- --pathprints the path to- NAMEif- NAMEresolves to an executable file in $PATH, the path to the script containing the definition of the function- NAMEif- NAMEresolves 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 file- NAME, presuming- NAMEis 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