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-alF:

img

the simplified version of ls -alF

More…

Keyword

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

img

these are system defined functions

More…

Function

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

img

it is a shell reversed keyword

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

these are system defined functions

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

If you think the content of this article has helped you, and if you would like some more high-quality materials in the near future, please give me some modest support.

Buy me a coffeeBuy me a coffee