Linux basics-Bash command priority, linux-bash priority
1. Bash Introduction
The command interpreter, also known as the Bourne Again Shell, originated from the shell. Shell, commonly known as shell, refers to a command parser in a UNIX system. It is mainly used for user-system interaction. There are many types of shells on UNIX systems. The first shell, namely, the Bourne Shell, was launched on V7 (AT&T 1978) UNIX in 7th. Later, different versions of shell, such as C shell and bash, were developed.
Bash is widely used in daily work because it is easy to use and free of charge. Bash is also the default Shell for most Linux systems. In general, people do not distinguish between the Bourne Shell and the Bourne Again Shell.#! /Bin/shIt can also be changed#! /Bin/bash. #! Tell the system that the program specified in the subsequent path is the Shell program that interprets the script file.
Ii. command priority
1. Get a command execution priority level, top down
Alias
Compound commands
Function
Build_in
Hash
$ PATH
Error: command not found
2. Command Classification
Alias (alias): to simplify the integration of output to a long parameter command, the alias definition method alias la = 'LS-al' cancels the alias unalias la;
Built_in (Internal Command): the bash built-in command function is simple, and the help of Internal commands is in builtin (1;
External command: A small program exists in/bin/sbin/usr/bin and other places.
3. command priority verification
A. Verify that the alias takes precedence over internal and external commands.
Conclusion: Command Execution search order: alias (alias can be viewed) -- bash Internal Command -- $ PATH search for each PATH separated by colons
B. Verify that the alias takes precedence over the compound command)
C. Verify that compound commands take precedence over functions)
D. Verify that the function takes precedence over built-in commands.
Conclusion: The Command Execution search sequence is as follows:Alias (alias can be viewed) -- composite command -- function --Bash internal command --$ Search for each PATH separated by a colon in PATH
E. Verify that hash takes precedence over $ PATH.
The final verification conclusion is: Command Execution search order: alias (alias can be viewed) -- composite command -- function -- built-in command -- bash Internal Command -- $ PATH search for each PATH separated by a colon
References
1. http://www.cnblogs.com/linhaifeng/p/6592572.html#_labelTop
2. http://www.cnblogs.com/skywang12345/archive/2013/05/30/3106570.html#a12