type [OPTIONS] NAME
-a or --all
: prints exe, function (with definition expansion), and built-in.
-s or --short
: suppresses function definition expansion.
-f or --no-function
: suppresses function and built-in lookup.
-t or --type
: prints the type currently working of command:
function
builtin
file
If NAME
is a shell function, a builtin, or a disk file, respectively
-p or --path
: prints the path to the currently working command with its coresponding type
- The path to
NAME
ifNAME
is resolves to an executable file inPATH
. E.g./c/Python311/python
- The path to the script containing the definition of function
NAME
ifNAME
resolves to a function loaded from a disk file. E.g./c/Users/hacki/.dotfiles/fish/functions/python.fish
- Nothing otherwise.
-P or --force-path
: returns ONLY:
- The path to the exe file (presumes that the exe is found inside
PATH
) - Nothing otherwise.
It omitted function and builtin even though they still exists.
-q or --query
: suppresses all output, VERY USEFUL when checking the exit status of a command to determine whether it's a command or not?