Multi-command sequential execution in Linux and command sequential execution in Linux

Source: Internet
Author: User

Multi-command sequential execution in Linux and command sequential execution in Linux




Command input for sequential execution of batch processing files in linux

You can add a semicolon between two or more commands. For example, if you want to create a folder under/, create a file in the folder, and grant the file 777 permissions. You can write it like this:
Mkdir/test; touch/test/1.txt; chmod 777/test/1.txt
There is also a Pipeline character. The pipeline operator is used to connect several commands. The command on the left of the pipeline operator is the output, and the command on the right of the pipeline operator is an input to the left output (sometimes it can be understood as a condition)
For example, if there is a file with 100 rows (Suppose it is/a.txt), you only want to view 25th rows, you can write it like this:
Head-25/a.txt | tail-1

The header-25/a.txt on the left of the pipeline operator indicates to view the first 25 rows of the file,
The right side of the MPs queue operator is the last line,
This command can be considered as the first line to the last of the first 25 lines of the file, that is, the second line.

Execute multiple commands at a time on a linux terminal

Add the & symbol in the middle of the command, for example, make & make install, to indicate that the previous command is executed after
In addition, The rpm-qa | wc-l pipe symbol indicates that the preceding command execution result is used as the input of the subsequent command.

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.