type -t alias keyword function builtin file | ls is aliased to `ls --color=tty'

[me@linuxbox me]$ type type
type is a shell builtin
[me@linuxbox me]$ type ls
ls is aliased to `ls --color=tty'
[me@linuxbox me]$ type 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:
CommandOutputMeaning
type -t lsaliasls command is alias which can be verified by typing the alias command itself at a shell prompt:
alias
type -t datefiledate 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 xrpmfunctionxrpm is a user defined function.
type -t ifkeywordif is a shell reserved word, which is used for flow control.
type -t pwdbuiltinpwd is a shell builtin command.

Comments

Popular posts from this blog

HAproxy logging

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all

teamcity Automatic Agent Start under Linux