aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/type.txt
blob: c3265f382b68b220d80dab00358878e0d277c5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
\section type type - indicate how a command would be interpreted

\subsection type-synopsis Synopsis
\fish{synopsis}
type [OPTIONS] NAME [NAME ...]
\endfish

\subsection type-description Description

With no options, `type` indicates how each `NAME` would be interpreted if used as a command name.

The following options are available:

- \c -h or \c --help prints help and then exits.
- \c -a or \c --all prints all of possible definitions of the specified names.
- \c -f or \c --no-functions suppresses function and builtin lookup.
- \c -t or \c --type prints <tt>function</tt>, <tt>builtin</tt>, or <tt>file</tt> if \c NAME is a shell function, builtin, or disk file, respectively.
- \c -p or \c --path returns the name of the disk file that would be executed, or nothing if 'type  -t  name' would not return 'file'.
- \c -P or \c --force-path returns the name of the disk file that would be executed, or nothing if no file with the specified name could be found in the <tt>$PATH</tt>.
- \c -q or \c --quiet suppresses all output; this is useful when testing the exit status.

`type` sets the exit status to 0 if the specified command was found,
and 1 if it could not be found.

\subsection type-example Example
\fish
type fg
# Outputs the string 'fg is a shell builtin'.
\endfish