之前对linux操作的一些操作和管理命令,那么这些命令有什么功能,这就需要帮助命令了。

 

 

万能的帮助命令



• 为什么要学习帮助命令



• man 帮助



• help 帮助



• info 帮助



• 使用网络资源(搜索引擎和官方文档)


 

 

 

为什么要学习帮助命令


  • Linux 的基本操作方式是命令行
  • 海量的命令不适合“死记硬背”
  • 你要升级你的大脑

 

 

man 帮助



man 是 manual 的缩写


man 帮助用法演示


NAME
ls - list directory contents

SYNOPSIS
ls [OPTION]... [FILE]...

DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is
specified.

Mandatory arguments to long options are mandatory for short options too.

-a, --all
do not ignore entries starting with .

-A, --almost-all
do not list implied . and ..

--author
with -l, print the author of each file

-b, --escape
print C-style escapes for nongraphic characters


//可以查看到其功能 ls - list directory contents 列出目录里面的内容
//所有选项的内容在下面全部列出来了
//q可以退出命令行的终端

man 也是一条命令,分为 9 章,可以使用 man 命令获得 man 的帮助(可以获取不同篇章的帮助)

如果想要活得ls第一章的帮助就是使用man 1 ls,在使用的时候往往可以将1进行省略。


       The table below shows the section numbers of the manual followed by the types of pages they contain.

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]


//man命令的第二章系统调用(必须由内核完成的功能),第三章是库调用(大多数libc函数,如qsort())


 

help 帮助


  • shell(命令解释器)自带的命令称为内部命令,其他的是外部命令
[root@docker ~]# type cd
cd is a shell builtin
  • 内部命令使用 help 帮助
  • # help cd


  • 外部命令使用help帮助
  • # ls --help

 

 

 

info 帮助


• info 帮助比 help 更详细,作为 help 的补充


• # info ls