Type is a command to view command types. We can look at what types this command can see with the help of the help command:

img

there are five types

Alias

Alias is a shortcut to commands, such as ll is a simplified version of ls -l:

img

the simplified version of ls -l

More…

Keyword

Shell has some reserved keywords, while is one of them:

img

it is a system defined keyword

More…

Function

We can use the declare -F command to get the defined functions.

img

these are shell reversed functions

From the results of the command execution above, we know that quote is a function:

img

it is a shell reversed keyword

We can also use declare’s synonym to get the function, which is typeset:

img

typeset is a synonym of declare

More…

Builtin

The declare command we use is built into Bash:

img

it is a bash shell builtin command

More…

File

Some of the commonly used file type commands are mkdir, cp, mv, touch, rm:

img

commonly used file type commands

We can append the -t parameter behind the type command to get the commands types:

img

list types by appending the -t parameter

References Type Manual, Alias Command Shell Reserved Words, Shell Functions, Shell Builtin Commands, File Command

Buy me a coffeeBuy me a coffee