We all know: The reading of files in the computer
memory > Cache > HDD
The alias in Linux is to simplify the input of certain commands, and in the terminal input
aliasCan query the system exists alias, the user can also customize the alias, specifically:
Alias aliases = ' Command '
[[email protected] ~]# alias hist=‘history‘
[[email protected] ~]# hist 1 alias hist=‘history‘ 2 type hsit 3 type hsitory 4 enable 5
Use enable in Linux to get all the internal commands for Linux
Use enable-n command to disable the specified internal command in Linux
Using enable-n to display the disabled internal commands in Linux
The following is a comparison of precedence between aliases and internal commands
[[email protected] ~]# type touch touch是外部命令touch is /bin/touch[[email protected] ~]# type cd
You can see that aliases take precedence over internal commands
The following is the priority of the external command compared to the hash cache:
The system initial hash table is empty, if the system restarts will also be emptied, when the external command execution will go to the path to find the command, and then recorded in the hash, when the execution of the hash to take, which will speed up the execution speed. And the hash doesn't hold internal commands.
[[email protected] ~]# hash -r[[email protected] ~]# dateSat Jul 14 00:23:49 CST 2018[[email protected] ~]# hashhits command 1
Clears all caches in the hash, executes date, still reads from cache to date, but date has been moved to another location and cannot be executed, indicating that the hash is higher than the external path
The following is an internal command compared to the hash cache priority:
Internal commands exist directly at the memory startup and are placed directly inside the memory. Hash cache must execute the command to exist in the hash, and the hash cache inside does not put internal commands, indicating the input internal command, will not go to the hash to find, directly run. So the internal command >hash the cache.
Summary: alias > Internal command > Hash Cache > Path (external path)
Comparison of priorities in Linux for aliases, internal commands, hash caches, and external commands (paths on the hard drive).