Home  >  Article  >  Operation and Maintenance  >  How to view detailed parameters and options of commands in Linux

How to view detailed parameters and options of commands in Linux

青灯夜游
青灯夜游Original
2023-02-10 10:35:575582browse

Viewing method: 1. Use the man command to display the contents of the system manual page. Most of these contents are explanations of commands, as well as some related descriptions. The syntax is "man specify command". 2. Use the help command to display brief help information for the shell's built-in commands. The help information displays a brief description of the command and the use and description of some parameters. The syntax is "specify command --help". 3. Use the info command with the syntax "info specified command".

How to view detailed parameters and options of commands in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

We know that under the Linux system, various operations are performed based on the console, such as the directory switching command cd, the display current path command pwd, the disk mounting command mount, the file system analysis command df, etc.

If you forget how to use a certain command, or need to view the detailed parameters and options of a command, we can use the man command, help command and info command.

Linux man command detailed explanation

man command, which is the abbreviation of Manual pages, is a common type of online software documentation in Linux systems Its content includes computer programs (including libraries and system calls), formal standards and conventions, abstract concepts, etc.

The man tool displays the contents of the system manual page, which is an electronic dictionary. Most of these contents are explanations of commands and some related descriptions. By viewing the system documentation You can also get more information about the program and more features of Linux through man.

Function

Usually used to obtain a description of a command and a detailed introduction to how to use it.

Syntax

man 命令

Instructions

You can use the man command to view its own instructions, that is: man man

Partition section of the man manual

The man manual has a lot of content, covering all aspects of using Linux. In order to facilitate search, the man manual has been divided into volumes (partition sections). The manual is usually Divided into the following 9 sections:

Section number Description
1 Standard commands
2 System calls
3 Library functions
4 Special devices
5 File formats
6 Games and toys
7 Miscellaneous (Miscellaneous)
8 Administrative Commands (System Management Commands and Daemons)
9 other (other, used to store documents for kernel routines)

man man page layout

All man pages follow a common layout, generally including the following parts:

Display information Description
Manual name and chapter The manual name and chapter will be displayed at the top of the manual.
NAME (name) The name of the command or function, followed by a line of introduction.
SYNOPSIS (Summary) For a command, a formal description of how it is run and what command line arguments are required. For functions, describe the parameters required by the function and which header file contains the definition of the function.
DESCRIPTION Text description of the command or function function.
EXAMPLES Some commonly used examples.
SEE ALSO List of related commands or functions.

man手册的搜索

通常 man 手册中内容很多,不太容易找到想要的结果,可以在 man 中使用搜索:/str。当查找完毕后,可以按 n 切换到下一个关键字所在处,shift+n 切换到上一个关键字所在处。

man命令使用案例

我们使用 man 命令,查看 ls 命令的帮助信息,具体命令如下:

man ls

运行后,终端输出如下:

How to view detailed parameters and options of commands in Linux

我们看到,输出了 ls 命令的帮助信息,只需要按下 q 就可以退出。

Linux help命令详解

help 命令是用于显示 shell 内建命令的简要帮助信息,帮助信息中显示有该命令的简要说明以及一些参数的使用以及说明。

语法

命令 --help

何时选用 help 命令

当非常紧急只是忘记该用哪个参数的时候,help 这种显示简单扼要的信息就特别实用,若是不太紧急的时候就可以用 man 这种详细描述的查询方式。

help命令使用案例

我们使用 help 命令,查看 ls 命令的帮助信息,具体命令如下:

ls --help

运行后,终端输出如下:

How to view detailed parameters and options of commands in Linux

如果遇到某些命令没有--help参数选项时,怎么办呢?,比如‘popd命令’

How to view detailed parameters and options of commands in Linux

这里仅给出了 popd命令用法,但没有给出关于这个命令的详细说明,此时就需要用上linux中的man命令了。

Linux info命令详解

如果觉得 man 显示的信息都还不够,满足不了需求,那么可使用 info 命令来获取帮助。info 来自自由软件基金会的 GNU 项目,是 GNU 的超文本帮助系统,能够更完整的显示出 GNU 信息。

语法

info command

说明:

man 和 info 就像两个集合,它们有一个交集部分,但与 man 相比,info 工具可显示更完整的 GNU 工具信息。

info命令使用案例

我们使用 info 命令,查看 ls 命令的帮助信息,具体命令如下:

info ls

运行后,终端输出如下:

How to view detailed parameters and options of commands in Linux

我们看到,输出了 ls 命令的帮助信息。

相关推荐:《Linux视频教程

The above is the detailed content of How to view detailed parameters and options of commands in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn