Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common command line formats of Linux Shell

Shulou Source: shulou.com Published: 2022-06-03 07:53:35 11月15日 Update

This article mainly introduces "what are the common command line formats of Linux Shell". In daily operation, I believe many people have doubts about the common command line format of Linux Shell. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the common command line format of Linux Shell?" Next, please follow the editor to study!

The code is as follows:

# execute cmd instructions in the background

Cmd &

# Command sequence. Execute multiple commands on the same line

Cmd1; cmd2

# execute multiple commands in a group in the current shell

{cmd1; cmd2;}

# execute multiple commands in a group in a child shell

(cmd1; cmd2)

# Pipeline. Use the execution output of cmd1 as the input of cmd2

Cmd1 | cmd2

# command replacement. Take the execution output of cmd2 as the parameter of cmd1

Cmd1 `cmd2`

# POSIX command to replace. Allow nesting

Cmd1 $(cmd2)

# POSIX arithmetic substitution. Take the result of the expression expression as a parameter to cmd

Cmd $((expression))

# AND. Execute cmd1, then execute cmd2 (if cmd1 executes successfully). If cmd1 execution fails, cmd2 will not be executed

Cmd1 & & cmd2

# OR. Either execute cmd1 or execute cmd2 (if cmd1 fails). If the cmd1 executes successfully, the cmd2 will not be executed

Cmd1 | | cmd2

# NOT. Execute cmd and generate an exit status code of 0 (if the exit status of cmd is non-zero). Otherwise, a non-zero exit status code is generated (if the exit status of cmd is zero).

! Cmd

At this point, the study of "what are the common command line formats of Linux Shell" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Commands common format state learning multiple success parameters form more or help output utility next one line code background sequence instruction Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker Shulou Technology MySQL macOS