Linux
  1. Linux文件和目录管理
  2. Linux打包和压缩
  3. Linux文本管理
  4. Linux用户和用户组
  5. Linux权限管理
  6. Linux进程管理
  7. Linux命令
    1. Linux stat命令:显示文件或文件系统的详细信息-7.1
    2. Linux man命令:显示联机帮助手册-7.2
    3. Linux info命令:info格式的命令帮助指令-7.3
    4. Linux whereis命令:査找二进制命令、源文件和帮助文档-7.4
    5. Linux which命令:列出命令的所在路径-7.5
    6. Linux find命令:在目录中查找文件-7.6
    7. Linux shutdown命令:关机和重启-7.7
    8. Linux ifconfig命令:查看和临时修改IP地址-7.8
    9. Linux ping命令:测试主机通信情况命令-7.9
    10. linux netstat命令:网络状态查看命令-7.10

Linux man命令:显示联机帮助手册-7.2

程序员日记      2019-07-25

Linux 自带的帮助命令是最准确、最可靠的资料。很多其他途径搜索到的信息都不准确,甚至是错误的。所以,虽然 Linux 自带的帮助命令是英文的,但是我们要静下心来慢慢学习。

man 是最常见的帮助命令,也是 Linux 最主要的帮助命令.

基本信息

命令名称:man。

英文原意:format and display the on-line manual pages。

所在路径:/usr/bin/man。

执行权限:所有用户。

功能描述:显示联机帮助手册。

命令格式

[root@localhost ~]# man [选项]命令

选项

-f:査看命令拥有哪个级别的帮助

-k: 査看和命令相关的所有帮助

基本用法

[root@VM_0_10_centos test]# man ls #查看LS命令的帮助信息
LS(1)                            User Commands                           LS(1)
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.
       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 octal escapes for nongraphic characters
       --block-size=SIZE
              use SIZE-byte blocks.  See SIZE format below
       -B, --ignore-backups
              do not list implied entries ending with ~
       -c     with -lt: sort by, and show, ctime (time of last modification of file status information) with -l: show ctime and sort by name otherwise: sort by ctime
       -C     list entries by columns
       --color[=WHEN]
              colorize the output.  WHEN defaults to ‘always’ or can be ‘never’ or ‘auto’.  More info below
       -d, --directory
              list directory entries instead of contents, and do not dereference symbolic links
       -D, --dired
              generate output designed for Emacs’ dired mode
       -f     do not sort, enable -aU, disable -ls --color
       -F, --classify
              append indicator (one of */=>@|) to entries
       --file-type
              likewise, except do not append ‘*’
       --format=WORD
              across -x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical -C

man命令的快捷键

上箭头 向上移动一行

下箭头 向下移动一行

PgUp 向上翻一页

PgDn 向下翻一页

g 移动到第一页

G 移动到最后一页

q 退出

/字符串 从当前页向下搜索字符串

?字符串 从当前页向上搜索字符串

n 当搜索字符串时,可以使用n键找到下一个字符串

N 当搜索字符串时,使用N键反向查询字符串。也就是说,如果使用“/字符串”方式搜索, 则N键表示向上搜索字符串;如果使用“?字符串”方式搜索,则N键表示向下搜索字符串

man命令的帮助级别

不知道大家有没有注意到,在执行 man 命令时,命令的开头会有一个数字标识这个命令的帮助级别

LS(1)                            User Commands                           LS(1)
#这里(1)就表示这是 ls 的 1 级别的帮助信息

级别的含义

1 普通用户可以执行的系统命令和可执行文件的帮助

2 内核可以调用的函数和工具的帮助

3 C语言函数的帮助

4 设备和特殊文件的帮助

5 配置文件的帮助

6 游戏的帮助(个人版的Linux中是有游戏的)

7 杂项的帮助

8 超级用户可以执行的系统命令的帮助

9 内核的帮助