Built-in commands and external commands under Linux
1, the Linux command can be divided into internal commands and external commands:
Internal commands are transferred into memory when the system starts, and are resident in memory, so the execution efficiency is high.
The external command is the software function of the system, and the user is required to read the memory from the hard disk.
Enable allows you to view internal commands as well as to determine whether they are internal.
[[email protected] ~]# enable ls //determine if LS is a built-in command
/span>-bash:enable:ls:not a shell builtin//It is not an internal command
[[email protected] ~]# enable PWD//pwd for internal Commands
[[email ;p rotected] ~]# enable-n//Turn off use pwd internal command-n
[Email protected] ~]# enable-a| grep pwd//check to see if close
Enable-n pwd
[[email protected] ~]# enable PWD//turn on using PWD built-in commands
[Email protected] ~]# enable-a| grep pwd
Enable PWD
Internal command user input the rate of system calls is fast, not the built-in command, the system will read the environment variable file. bash_profile,/etc/profile to find the path.
Then in the case of a call to the command, some historical commands are used later, it will exist in the hash table, and when you re-enter the command its call will be such a process.
Hash--> the call to the built-in command-->path command should actually be such a process.
[Email protected] ~]# pwd
/root
[[email protected] ~]# ls
Anaconda-ks.cfg Install.log Install.log.syslog
[[email protected] ~]# hash-l//Display hash table
Builtin Hash-p/bin/cat Cat
Builtin hash-p/bin/ls ls
It can be seen from the hash table. The hash table does not hold the system built-in commands.
<linux built-in commands and external commands >