Symbol |
Role |
Linux wildcard characters |
* |
Match any (0 or more) characters or strings, including an empty string |
? |
Matches any 1 characters, with only one character |
[ABCD] |
Matches any one character in ABCD, and ABCD is any other discontinuous character. |
[A-z] |
Matches any one of the characters from A to Z, A to Z indicates the range, the character is contiguous before and after,-meaning of the range, or continuous number [1-9] |
[!ABCD] |
Same as [^ABCD], which means that it does not match any one of the characters in the parentheses, or it can be [!a-d] |
Linux Special symbols: path and location related |
~ |
User's home directory, super User is/root, normal user is/// |
- |
Represents the path of the last (relative to the current path) user |
. |
Represents the current directory (the point number has many other meanings, not the table) |
.. |
Represents the previous level of the directory |
Linux Special Symbols: Reference string command related |
‘‘ |
Single quotes, WYSIWYG, that is, the output of the single quotation mark content will be all the contents of the single quotation marks are output, or described as a single quotation mark inside what will output what is called a strong reference |
"" |
Double quotation marks, when the output of all content in double quotation marks, if there are commands in the content (to be reversed), variables, special escape characters, etc., will first parse the variables, commands, escape character results, and then in the output of the final content, recommended to use, known as weak reference |
Empty |
When assigning a value, if the variable contents and spaces are assigned an incomplete value. In the output, the string containing the space will be treated as a whole output, if the contents of the command (to reverse), variables, etc., will first parse the variables, commands, and then output the final content, if the string with a space and other special characters, it may not be complete output, so need to add double quotation marks, Generally contiguous string, number, path, etc. can be no quotation marks and output, but the case without quotation marks should be replaced with double quotes, especially when the variable is assigned value |
`` |
Anti-quotation marks, commonly used to refer to commands, executed when the command will be executed, equivalent to $ (), assignment and output to the command "' cause |
Linux Special Symbols: Others |
; |
Represents the end of a command and also the delimiter between commands |
# |
1) is the comment content, to the administrator to see the comments section, the system will not execute the first part of the well number 2) root user command prompt |
| |
Represents a pipeline that outputs intermediate content after a command is processed to the next command to continue processing |
$ |
1) string with a $ sign, representing string variable contents 2) normal user command prompt |
\ |
Escape, a character that is about to have a special meaning restored to its original character, for example, \$ only represents a dollar symbol |
{} |
1) Generate sequence 2) a reference variable is separated from a normal character as a variable |
& |
Put the program into the background run, for example:/bin/sh/scripts/oldboy.sh & (later) |
Linux Special Symbols: REDIRECT Series special characters |
0 |
Represents standard input (stdin), with < or << use, data flow from right to left |
1 |
Represents standard output (Stdou), with > or >> use, data flow from left to right |
2 |
Standard error (STDERR), with > or >> usage, data flow from left to right |
0< or < |
Standard input redirection, emptying of existing content, data flow from file to processed commands |
0<< or << |
Append input redirection, append content to bottom, data flow from file to processing command |
1> or > |
Standard output redirection, normal output redirected to file, empty existing content |
1>> or >> |
Standard output append redirect to append content to the bottom of file without emptying existing content |
2> |
Error output redirection, redirect standard error content to file, empty if file exists |
2>> |
Error output append redirect to append standard error content to the bottom of file without emptying existing content |