type

描述一个命令,对于每个名称,表示如果用作命令名,将如何解释它。

语法

  type [-atp] [name ...]

选项

如果使用-t'选项,则type输出一个单词,它是以下之一:alias’ (shell 别名)
function' (shell 函数)builtin’ (shell builtin)
file' (磁盘文件)keyword’ (shell 保留字)

如果找到名称,则返回状态为零,否则为非零。
type是BASH内置命令。

例子

$ type -a grep
grep is /usr/bin/grep

$ type type
type is a shell builtin

$ type lsl
lsl is a function
lsl ()
{
ls -l $1
}

type 命令实例:

linux命令:type echo echo type type echorootopen.com
linux命令:type echo echo type type echorootopen.com
2018-08-09 21:37:57

linux命令:type C:\WINNT\system32\inetsrv\MetaBase.xml | find "400" | find "CustomError" "CustomError" find | "400" find | C:\WINNT\system32\inetsrv\MetaBase.xml type type C:\WINNT\system32\inetsrv\MetaBase.xml | find "400" | find "CustomError"rootopen.com
linux命令:type C:\WINNT\system32\inetsrv\MetaBase.xml | find "400" | find "CustomError" "CustomError" find | "400" find | C:\WINNT\system32\inetsrv\MetaBase.xml type type C:\WINNT\system32\inetsrv\MetaBase.xml | find "400" | find "CustomError"rootopen.com
2018-04-17 23:06:48

linux命令:type C:\WINNT\system32\inetsrv\MetaBase.xml | find "DEBUG" "DEBUG" find | C:\WINNT\system32\inetsrv\MetaBase.xml type type C:\WINNT\system32\inetsrv\MetaBase.xml | find "DEBUG"rootopen.com
linux命令:type C:\WINNT\system32\inetsrv\MetaBase.xml | find "DEBUG" "DEBUG" find | C:\WINNT\system32\inetsrv\MetaBase.xml type type C:\WINNT\system32\inetsrv\MetaBase.xml | find "DEBUG"rootopen.com
2018-01-03 16:08:48

linux命令:type "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat" Shared\VirusDefs\definfo.dat" Files\Symantec Files\Common "C:\Program type type "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat"rootopen.com
linux命令:type "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat" Shared\VirusDefs\definfo.dat" Files\Symantec Files\Common "C:\Program type type "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat"rootopen.com
2018-04-19 09:54:48

linux命令:type -all command command -all type type -all commandrootopen.com
linux命令:type -all command command -all type type -all commandrootopen.com
2018-03-05 16:53:48

linux命令:typeset -f <function-name> <function-name> -f typeset typeset -f <function-name>rootopen.com
linux命令:typeset -f <function-name> <function-name> -f typeset typeset -f <function-name>rootopen.com
2018-05-19 15:42:48

linux命令:type <filename> <filename> type type <filename>rootopen.com
linux命令:type <filename> <filename> type type <filename>rootopen.com
2018-04-01 03:56:48

linux命令:type <command> <command> type type <command>rootopen.com
linux命令:type <command> <command> type type <command>rootopen.com
2018-01-25 16:06:48

linux命令:typeset -f <function name>; declare -f <function name> name> <function -f declare name>; <function -f typeset typeset -f <function name>; declare -f <function name>rootopen.com
linux命令:typeset -f <function name>; declare -f <function name> name> <function -f declare name>; <function -f typeset typeset -f <function name>; declare -f <function name>rootopen.com
2018-05-27 07:45:48

linux命令:type -a python python -a type type -a pythonrootopen.com
linux命令:type -a python python -a type type -a pythonrootopen.com
2018-04-09 18:01:48

linux命令:type () { if [ "$1" = "-c" ]; then shift; for f in "$@"; do ff=$(builtin type -p "$f"); readlink -f "$ff"; done; else builtin type $typeopts "$@"; fi; } } fi; "$@"; $typeopts type builtin else done; "$ff"; -f readlink "$f"); -p type ff=$(builtin do "$@"; in f for shift; then ]; "-c" = "$1" [ if { () type type () { if [ "$1" = "-c" ]; then shift; for f in "$@"; do ff=$(builtin type -p "$f"); readlink -f "$ff"; done; else builtin type $typeopts "$@"; fi; }rootopen.com
linux命令:type () { if [ "$1" = "-c" ]; then shift; for f in "$@"; do ff=$(builtin type -p "$f"); readlink -f "$ff"; done; else builtin type $typeopts "$@"; fi; } } fi; "$@"; $typeopts type builtin else done; "$ff"; -f readlink "$f"); -p type ff=$(builtin do "$@"; in f for shift; then ]; "-c" = "$1" [ if { () type type () { if [ "$1" = "-c" ]; then shift; for f in "$@"; do ff=$(builtin type -p "$f"); readlink -f "$ff"; done; else builtin type $typeopts "$@"; fi; }rootopen.com
2018-04-30 09:09:48

linux命令:type <function name> name> <function type type <function name>rootopen.com
linux命令:type <function name> name> <function type type <function name>rootopen.com
2018-02-05 22:00:48

linux命令:type {command} >/dev/null >/dev/null {command} type type {command} >/dev/nullrootopen.com
linux命令:type {command} >/dev/null >/dev/null {command} type type {command} >/dev/nullrootopen.com
2018-01-13 20:01:48

linux命令:type -t $1 $1 -t type type -t $1rootopen.com
linux命令:type -t $1 $1 -t type type -t $1rootopen.com
2018-05-11 03:35:48

linux命令:typeset -f -f typeset typeset -frootopen.com
linux命令:typeset -f -f typeset typeset -frootopen.com
2017-12-30 22:48:48

Linux的Bash命令行(A-Z排序)