How to get command Help information and man document partitioning on Linux systems

Source: Internet
Author: User
Tags stdin switches

How to get command Help information on Linux system and chapter partition of man document

1. Order--Help

2. Man command

The latter more detailed

First help the middle angle brackets <> and square brackets [] as well as the ellipsis ... The meaning,

The expression within square brackets (the character between "[" and "]") is optional (the parentheses are removed when the command is written).
The expression within the angle brackets (the character between "[" and "]") is an expression that must be replaced (and the parentheses are removed).

An ellipsis indicates that the option can be single or multiple

Take the 7z parameter as an example:

7z [ ...] <archive_name> [<file_names> ...] [< @listfiles ...;]

7z < command line > [[Options] ...] < archive name (Zip package name) > [< compressed file name; ...] [<@ file list (e.g. file list in TXT file) ...;]

Example Analysis:

7z a-tzip-p111 archive.zip txt.txt txt.txt file compressed to Archive.zip, zip password is 111
7z x-tzip-p111 archive.zip decompression password is 111
A is a command, the command must have at least one

-T/-p is an option (switch), optional 0 or more, zip and 111 are parameters of-T and-P, which do not require an empty cells item (such as-R) to be placed in front of the line

7z commands are not case-sensitive, and some commands such as CP have to be differentiated ... Take care.

command Essentials reference

A:add files to archive add a file to a compressed package
B:benchmark
d:delete files from archive Delete a file from a compressed package
E:extract Files from archive (without using directory names) releases the file from the compressed archive into the current directory. Or to the specified output folder. Output folder settings can be changed by the-O (Set output folder) option.
L:list contents of Archive View the list of files in a compressed package
T:test integrity of archive
U:update files to archive
X:ex tract files with full paths in the current directory, the file is freed from the compressed archive using the complete path. Or to the specified output folder. For more details, see the E (Release) command.
Example
7z x archive.zip
Releases all files from the compressed archive Archive.zip to the current folder.
7z x archive.zip-oc:\soft *.cpp
releases *.cpp files from the compressed archive archive.zip to the C:\soft folder.

-ai[r[-|0]]{@listfile |! Wildcard}: Include archives-ax[r[-|0]]{@listfile |! Wildcard}: EXclude archives-bd:disable percentage indicator-i[r[-|0]]{@listfile |! Wildcard}: Include Filenames-m{parameters}: Set compression method-o{directory}: Set Output directory destination file directory-p{password }: Set Password {} curly braces for re-entry multi-parameter, some with parameters, some without-r[-|0]: Recurse subdirectories-scs{utf-8 | WIN | DOS}: Set charset for List Files-sfx[{name}]: Create SFX Archive-si[{name}]: Read data from Stdin-slt:show technical I Nformation for L (List) command-so:write data to stdout-ssc[-]: Set sensitive case Mode-t{type}: Set Type of archive- U[-][p#][q#][r#][x#][y#][z#][!newarchivename]: Update options-v{size}[b|k|m|g]: Create Volumes-w[{path}]: Assign Work directory. Empty path means a temporary directory-x[r[-|0]]]{@listfile |! Wildcard}: EXclude filenames-y: Assume Yes on all queries

Option Essentials Reference
Option description
--Block option resolution
-ai attachment File File name
-an does not parse the file name
-ao Overlay Mode
-ax exclude file file names
-I includes file names
-M set compression algorithm
-o Set Output directory common
-P Setting password
-R Recursive sub-directory common
-sfx creating a self-release profile
-si reading data from stdin
-so writing data from stdout
-T setting the profile type
-U update option
-V Create a sub-volume
-W Set working directory
-X file name exclusions
-Y is all
--(Block option resolution) option
Disable the "--" option switch "-" after "-" on the command line. This allows files with the file name beginning with "-" to be used on the command line.

Chapter Division of the man document

Linux provides a rich help manual that you do not have to look for when you need to see the parameters of a command, as long as you have a man.

The Linux Man Handbook has several chapters:

The symbol represents the content
1 instructions or executables that the user can manipulate in the shell
2 system core can call functions and tools, etc.
3 Some common functions and function libraries (library), most of which are C's function libraries (LIBC)
4 description of the device file, usually in/dev files
5 profile or some file format
6 games
7 conventions and agreements, such as Linux file systems, network protocols, ASCII code, and so forth
8 Management instructions available to the System Manager
9 Documents related to kernel

Example: Man 5 data

1 executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 special files (usually found In/dev)
5 File formats and conventions eg/etc/passwd
6 games
7 miscellaneous (including macro packages and conventions), e.g. man (7), Groff (7)
8 System Administration commands (usually only for root)
9 Kernel routines [Non Standard]

1, standard commands (command)
2. System calls (Systems call)
3. Library functions (Libraries function)
4, special devices (equipment description)
5. File formats (document format)
6. Games and toys (game and entertainment)
7. Miscellaneous (Miscellaneous)
8, Administrative Commands (Administrator command)
9 Other (Linux-specific) documents used to store kernel routines.

N new documents, you may want to move to a more appropriate area.
o old documents may be retained for a period of time.
L Local documentation, related to this particular system.

For example: We enter the man LS, it will show "LS (1)" in the upper left corner, where "ls" denotes the manual name, and "(1)" means that the manual is in the first section, similarly, we enter "man ifconfig" it will show "ifconfig (8)" in the upper left corner. You can also enter the command: "Man [chapter number] Manual name".

The man is searched in the order of the chapter number of the manual, for example:
Mans sleep
Only the Manual of the Sleep command is displayed, and if you want to see the library function sleep, enter:
Mans 3 Sleep

Ubuntu default is not installed in the C language library function man manual

1. Add Library function Manual
Ubuntu By default is not installed in the C language library function man manual, so you in the man perror and SendTo and other functions will show no related documents problems, this problem let me depressed for a long time. Workaround:
sudo apt-get install Manpages-dev
2. Let man display Chinese
Ubuntu source contains the Chinese man pack, so do not go down from other places, directly
sudo apt-get install Manpages-zh
But this is not the default display of the Chinese language, but also need the following two steps
A. Convert Chinese man package to UTF8 format
Create a new script file
Gedit t.sh
Add the following content
#!/bin/bashcd/usr/share/man/zh_cn/for k in *docd $kfor i in *.gzdo j=echo ${i%.gz}Gunzip $i iconv-f gb18030-t UTF8 $j >tmp mv tmp $j gzip $JDONECD. Done
And then
sudo./t
B. Modifying a man's default language
sudo gedit/etc/manpath.config to change all the/usr/share/man inside into/USR/SHARE/MAN/ZH_CN.
Quit after saving, and then you try man ls
3. Show English without Chinese help
Finish the second part of the above is not enough, then you man a few C language functions (do not use printf,socket such as more famous functions, these already have Chinese help) when will find unexpectedly did not help, and just clearly in the first step has been installed AH. This is because you change the/usr/share/man to/USR/SHARE/MAN/ZH_CN of the operation so that man only in Chinese help search, if not directly give up, so also need the following actions, in order to let man without Chinese help automatically display English help, If there is no English, there is no real.
sudo gedit/etc/manpath.config
Then search for the place you just changed, and then add the same line behind it, just the back of the directory with the original/usr/share/man, such as in the modified
Manpath_map/bin/usr/share/man/zh_cn
Add another line
Manpath_map/bin/usr/share/man

How to get command Help information and man document partitioning on Linux systems

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.