type -t alias keyword function builtin file | ls is aliased to `ls --color=tty'
[me@linuxbox me]$ type type
type is a shell builtin
type is a shell builtin
[me@linuxbox me]$ type ls
ls is aliased to `ls --color=tty'
ls is aliased to `ls --color=tty'
[me@linuxbox me]$ type cp
cp is /bin/cp
cp is /bin/cp
Find Out Command Type (-t option)
If the -t option is used, it will print a single word which is one of the following
- alias (command is shell alias)
- keyword (command is shell reserved word)
- function (command is shell function)
- builtin (command is shell builtin)
- file (command is disk file)
type -t Command Examples
Try the following examples:
Command | Output | Meaning |
---|---|---|
type -t ls | alias | ls command is alias which can be verified by typing the alias command itself at a shell prompt:alias |
type -t date | file | date command is a disk file (external command), which can be verified by issued the which date command at a shell prompt:which date |
type -t xrpm | function | xrpm is a user defined function. |
type -t if | keyword | if is a shell reserved word, which is used for flow control. |
type -t pwd | builtin | pwd is a shell builtin command. |
Comments
Post a Comment