Linux System Shell Basics (iii)

Source: Internet
Author: User

I. Special symbols in the shell

Number: wildcard character, can match 0 or any number of characters
? Number: Tan,
#号: An annotation character that is followed by a command or parameter that does not execute
\ No.: Raise the meaning of the instruction before the special symbol
| Pipe break: Pass the result of one command to another command, note that the latter command is not a command, usually a command for a document. such as less, more, head, tail, grep, sed, awk, and so on.
$: variable prefix,! ¥
; Multiple commands are written to one line;
~ User home directory substitute, root home directory, regular indicates match
& at the end of the command to put the command in the background

Output both correct and incorrect results to a file

Used in the shell to represent or
Indicates if command 1 fails to execute command 2, if command 1 succeeds then command 2 is not executed, and only one command between commands 1 and 2 executes
&& indicates that if command 1 fails, the command terminates, all commands are not executed, command 2 executes if command 1 succeeds, command 1, 2 either executes, or none executes.

Example

1, II and && examples of special symbolic meanings

In this example, the Touch test2 command is executed only if LS test2 is successful. Because the test2 does not exist, the previous command is unsuccessful, and a subsequent command will not execute

Then we change to ls test2 | | Touch Test2 See

In this case, because the previous command LS Test2 failed, the 2nd command was executed.

Ii. commands related to pipe breaks

1. Cut command
Separator

2. Sort command
3, WC command,
4. Uniq command
5. Tee command
6. TR command
7. Split command

Linux System Shell Basics (iii)

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.