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.