Interpretation of Linux command format

Interpretation of Linux command format

environment
Linux HA5-139JK 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64

There are many GNU/Linux Linux commands, but the article on the interpretation of the format itself is almost blank. They are all writing orders based on guesses about the format, and the information collected on the Internet is very small and incomplete. Write an article based on your own understanding, hoping to be useful to beginners.

1. The general format of the

command command [options] [arguments]

command: command
options: --word or -word
arguments: parameters, sometimes options also have parameters.

2. The meaning of symbols in the command format

When viewing the command help, there will be symbols such as [], <>, |, and their meanings are as follows:
[] means optional;
<> means variable options, generally multiple choices One, and it must be one of them.
Multiple x|y|z can be selected. If you add [], you can choose not to.
-abc Multiple choices, if you add [], you can choose not to.

3. Examples of common command formats

For command formats, the following formats can often be seen:
1. [--atime-preserve], indicating an optional option.
2. [ -B, --read-full-records ], represents an optional option, abbreviated as -B, and the full writing is --read-full-records. Only one of them can be selected when they are used. The functions are exactly the same. Generally, the options starting with "-" are shorthand, and the commands starting with "--" are full writing, and the general options have one shorthand and one full writing, the abbreviation is written in the front, the complete writing is written in the back, and the middle is written in the middle. Separate with commas.
3. [ -b, --blocking-factor N ], represents an optional option, abbreviated as -b N, the full writing is --blocking-factor N, N means that this parameter needs a value, which can be seen in the detailed description arrive. Of course, options can have parameters or no parameters. Most options have no parameters, which are equivalent to control switches. The command is written such as: tar -b=10000 -cvf com.tar.gz com
4, [ -F, --info-script F --new-volume-script F ], indicating that there are two optional commands that exist at the same time , -FF --new-volume-script F, the two options must appear at the same time, here, the latter options are not shorthand.
5. [ -z, --gzip, --gunzip, --ungzip ], which means an optional option. It can be written in many ways. Except for -z, everything else is its complete way of writing.
6. [ -[0-7][lmh] ], indicates nested optional options, 0-7 indicates a value from 0 to 7.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326320467&siteId=291194637
Recommended