(C) the symbols in the bash

5: pipe symbol

(1) line grep command to extract

(2) the difference between the find and grep

find order in which the system searches for qualified file name, if needed fuzzy query, use wildcard matching when searching for a file name is an exact match.

grep command is a file search among qualified string, if needed fuzzy query, use regular expression matching, match when the search string is included.

 

6: Tsuhaifu

? Matches an arbitrary character

* Matches zero or any number of any character, that is, can match any content.

[] Brackets match any one character. For example: [abc] represents a certain matches a character, or a, or B, or c.

[-] matches any character in the brackets, - a representative of the range. For example: [az] Representative matches a lowercase letter. [0-9]

[^] Logical negation, represents a character in brackets not match. For example: [^ 0-9] matches on behalf of a non-numeric characters.

 

7: Bash the special symbol

'' apostrophe. All in single quotes special symbols, such as "$" and "` "(backtick) have no special meaning.

"" Double quotes. In double quotes special symbols have no special meaning, but "$", "` "and" \ "is the exception, with" call variable values ​​"and" References Command "and" escape "special meaning.

`` Backtick. Anti quoted content is system commands, will first execute it in Bash. And $ () the same role, but is recommended to use $ (), because backticks very easy wrong.

$ () And backticks role as a reference for system commands.

() When used in a string of command, () commands will run in the sub-Shell

{} String when a command is executed, {} is executed command current Shell. Deformation can also be used with the replacement variable. echo $ {a [*]} 

[] For the test variable.

# Shell script, # represents the beginning of a comment line.

When the value of the variable $ a call, such as the need to call the value of the variable name, the value of the variable needs to be by way of $ name.

\ Escape character, with a special symbol \ will be lost after a special meaning, it becomes a normal character. Such as \ $ 26 outputs a "$" symbol, rather than as a variable reference.

Guess you like

Origin www.cnblogs.com/love-life-insist/p/11668757.html