created on | January 18, 2022 |
types of shell commands There are four types of shell commands:
shell builtin – commands, that are built into the shell. test and printf are more often than not shell builtins. Note, that a command can be available as a shell builtin and as an executable or shell script (see next type). An example on my system is the command test. compiled executable / shell script – compiled and installed programs. I.e., programs in /usr/bin and compiled programs installed in /usr/local/bin or somewhere in/opt.
Scripts, that are executed in a shell or an interpreter like Perl, which is available in most Linux systems in /usr/bin/perl. shell alias – aliases for commands that are defined in .bashrc. shell function – shell functions that are sourced (read) in .bashrc. checking command type with type To check the type of a command, run type <command>, i.e. type printf. The following section lists the output of type for the four types of shell commands listed above.
...