1. What is the build in command:
The shell built-in command refers to commands in the bash (or other versions) toolset. There is usually a system command with the same name, such as the echo command in bash and the/bin/echo are two different commands, although they are roughly similar in their behavior. When you type a command in bash, the system will first see if he is a built-in command, and if not, see if it is a system command or a third-party tool. So typing the echo command in bash actually executes the Bash command in the Bash toolset, which is the built-in command instead of/bin/echo the system command.
2. Built-in commands and system commands
The built-in command has higher execution efficiency than the system-theory command. External commands often need to fork out (produce) a sub-process, while the built-in commands are generally not used. Below (and perhaps later) this article will brief bash's built-in commands.
3. See if a command is a system command or built-in command: type
[Email protected]:~/documents
$ type-a pwd
PWD is a shell builtin
PWD is/bin/pwd
[Email protected]:~/documents
$ type-a Echo
Echo is a shell builtin
Echo Is/bin/echo
As you can see, some commands, Echo and PWD are both built-in commands and system commands.
4. Types of COMMON commands
[[email protected] ~]# type-a CD
CD is a shell builtin
[Email protected] ~]# type-a pwd
PWD is a shell builtin
PWD is/bin/pwd
[Email protected] ~]# type-a time
Time is a shell keyword
Time Is/usr/bin/time
[Email protected] ~]# type-a Date
Date Is/bin/date
[Email protected] ~]# type-a which
Which is aliased to ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
Which Is/usr/bin/which
[Email protected] ~]# type-a Whereis
Whereis Is/usr/bin/whereis
[Email protected] ~]# type-a Whatis
Whatis Is/usr/bin/whatis
[[email protected] ~]# type-a function
function is a shell keyword
[[email protected] ~]# type-a ls
LS is aliased to ' LS--color=tty '
LS Is/bin/ls
[Email protected] ~]# type-a ll
ll is aliased to ' ls-l--color=tty '
[Email protected] ~]# type-a Echo
Echo is a shell builtin
Echo Is/bin/echo
[Email protected] ~]# type-a Bulitin
-bash:type:bulitin:not found
[Email protected] ~]# type-a builtin
Builtin is a shell builtin
[Email protected] ~]# type-a keyword
-bash:type:keyword:not found
[[email protected] ~]# type-a command
command is a shell builtin
[Email protected] ~]# type-a alias
Alias is a shell builtin
[[email protected] ~]# type-a grep
grep is/bin/grep
[Email protected] ~]#
What is the built-in command of the bash shell