Linux Shell abs--Special characters

Source: Internet
Author: User
Tags arithmetic

The special characters are as follows: "#"--Comment, beginning with # at the beginning of the line (#! is an exception).
“;” --the command delimiter, which can be used to write multiple commands on a single line.
“;;” --Terminates the "case" option.
“.” --“.” The command is equivalent to the source command, which is a bash built-in command. "." If it is prefixed with a filename, then the file becomes a hidden file "." Character matching, which is part of a regular expression, is used to match any single character.
""--partial reference. " STRING "blocks some special characters.
"'"--full reference. ' STRING ' blocks all special characters.
","--comma links a series of arithmetic operations, although everything inside is run, but only the last item is returned, for example:
1 let "t2 = ((a = 9, 15/3))"
# Set "A = 9" and "t2 = 15/3"
"\"--the escape character, such as \x, is equivalent to "X" or "X".
"/"--File name path delimiter. or used to do the division operation.
"'"--post reference, command replacement.
":"--empty command, equivalent to "NOP" (no op, a command to do nothing). It can also be thought of as the Shell's built-in command (true). The ":" Command is a bash built-in command that returns a value of 0, which is true for the shell. For example:
Placeholders in If/then, such as:
1 if condition
2 Then: # doing nothing, branching out.
3 Else
4 take-some-action
5 fi
"Variable extension/substring substitution"
When used in conjunction with the > (redirection operator), truncates a file to a length of 0 without modifying its permissions.
If the file does not exist before, create it. such as:
1: > Data.xxx
2 #文件 "Data.xxx" is now emptied.
3 #与 cat/dev/null >data.xxx have the same effect.
4 #然而, this does not result in a new process because ":" is a built-in command.
“!“ --Take the inverse operator and the "exit status" result is reversed. It also reverses the meaning of the test operator. For example, modify =!=.! The action is a keyword for bash. In another context, you can also reverse bash's "history mechanism".
"*"--Universal match character for file name matching (this thing has a proper noun called file globbing), or a regular expression. Note: The role in regular expression matching and the role in file name matching is different. Also represents the multiplication operation, the power is "* *"
“?” --Test the operation. In a definite expression, test the result with a. (()) structure can be used to do mathematical calculations or to write C code, that is the C language of the 3-dollar operator of one.
“?” --matches any single character in file globbing and in regular expressions.
"$"--variable substitution
"$"--as a line terminator in a regular expression
"${}"--parameter substitution
"$*,[email protected]"--Position parameter
"$?" --Exit state variable. $? Save a command/function or the exit status of the script itself.
""−− Enter path id change volume this Variable save run script process ID
"()"--command group
"{}"--code block. It is also called an internal group. In fact, this structure creates an anonymous function. But unlike functions, the variables declared in them are still visible to the code of the rest of the script.
“{} \;” --path name. This is typically used in the Find command. This is not a shell built-in command. NOTE: ";" The-exec option used to end the find command sequence.
The expression "[]"--test will be in []. It is important to note that [is part of the shell built-in test command, not a connection to the extended command in/usr/bin/test.
The "[[]]"--test expression is placed in [[]] to see the discussion of the [[]] structure in detail.
"[]"--an array element, used in a regular expression, as a range of character matches.
"(())"--expansion of mathematical calculations.
">&>>&>><"-redirect.
"<,>"--ascii comparison
"\<,\>"--the word boundary in the regular expression. such as: Bash$grep ' \<the\> ' textfile
"|" --pipelines. Parses the output of the preceding command and outputs the output as input to the following command. This is a good way to generate a command chain
">|" --Forced redirection (even if the noclobber option is set--the-C option). This will force a overwrite of an existing file.
"||" --or-logical operation.
"&"--run the command in the background. A command is followed by a &amp, which will indicate running in the background.
"&&"--with--logical operation.
"-"--option, prefix. If you want to use the option parameter in all commands, add "-" to the front.
"-"--for redirecting stdin or stdout. For example:
CD Source/directory;tar CF-. | (CD..) /dest/directory; Tar XPVF-) Same as below
Cp-a/source/directory/*/source/directory/. [^.] */dest/directory
"-"--Directory of previous work. " CD-"Will go back to the previous working directory, please refer to the" $OLDPWD "environment variable.
"="--arithmetic equals, sometimes used to compare strings.
"+"--the arithmetic plus sign, also used in regular expressions, options, for specific commands to use "+" to open specific options.
"%"--arithmetic modulo operation. Also used in regular expressions.
"~+"--the current working directory, equivalent to the $PWD variable.
"~-"--Previous working directory, equivalent to $OLDPWD internal variables
"^"--the beginning of the line, in the regular expression. ^ "Navigates to the beginning of the line.
This article source: http://blog.csdn.net/yangzhifu/article/details/7251603

Linux Shell abs--Special characters

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.