A concise summary of command line formats common to Linux shells _linux shell

Source: Internet
Author: User
Tags posix

Copy Code code as follows:

#在后台执行 cmd command
CMD &

#命令序列. Execute multiple commands on the same line
CMD1; Cmd2

Execute multiple commands in a #在当前 shell in a set of forms
{cmd1; cmd2;}

Execute multiple commands in a #在子 shell in a set of forms
(CMD1; cmd2)

#管道. As input to CMD2 as CMD1 's execution output
cmd1 | Cmd2

#命令替换. As an cmd1 parameter with CMD2 's execution output
Cmd1 ' CMD2 '

Replace #POSIX command. Allow nesting
CMD1 $ (CMD2)

#POSIX arithmetic replacement. Expression The result of an expression as a parameter to cmd
CMD $ ((expression))

#AND. Perform cmd1, and then execute CMD2 (if cmd1 execution succeeds). If cmd1 execution fails, CMD2 is not executed
CMD1 && CMD2

#OR. Either execute CMD1 or execute cmd2 (if cmd1 execution fails). If cmd1 execution succeeds, CMD2 is not executed
cmd1 | | Cmd2

#NOT. Executes CMD and produces an exit status code of 0 (if Cmd's exit state is not 0). Otherwise, a Non-zero exit status code is generated (if CMD's exit State is 0).
! Cmd

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.