博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
获取帮助命令
阅读量:5317 次
发布时间:2019-06-14

本文共 4015 字,大约阅读时间需要 13 分钟。

  whatis

     基于数据库的查找,查找内容比较慢
         优点:查找速度快
         缺点:没有实时性

[root@localhost ~]# whatis lsls (1)               - list directory contentsls (1p)              - list directory contents

      数据库文件

         Centos6:/var/cache/man/whatis

         Centos7:/var/cache/man/index.db
     更新数据库文件
         Centos6:makewhatis
         Centos7:mandb

     help

    help是一个内部命令,help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看

 

 

[root@localhost ~]# type helphelp is a shell builtin

    help cd    //查看cd的帮助

[root@localhost ~]# help cdcd: cd [-L|[-P [-e]]] [dir]    Change the shell working directory.        Change the current directory to DIR.  The default DIR is the value of the    HOME shell variable.        The variable CDPATH defines the search path for the directory containing    DIR.  Alternative directory names in CDPATH are separated by a colon (:).    A null directory name is the same as the current directory.  If DIR begins    with a slash (/), then CDPATH is not used.        If the directory is not found, and the shell option `cdable_vars' is set,    the word is assumed to be  a variable name.  If that variable has a value,    its value is used for DIR.        Options:        -L force symbolic links to be followed        -P use the physical directory structure without following symbolic     links        -e if the -P option is supplied, and the current working directory     cannot be determined successfully, exit with a non-zero status        The default is to follow symbolic links, as if `-L' were specified.        Exit Status:    Returns 0 if the directory is changed, and if $PWD is set successfully when    -P is used; non-zero otherwise.     help pwd     help enable     ls --help

man    

中文man使用方法:

     1.  挂载光盘
     mount /dev/cdrom /media/
     2.  安装中文man的软件包
     rpm -ivh /media/Packages/man-pages-zh-CN-1.5.2-4.el7.noarch.rpm

[root@localhost ~]# mount /dev/cdrom /media/mount: /dev/sr0 is write-protected, mounting read-only[root@localhost ~]# rpm -ivh /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm warning: /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPreparing...                          ################################# [100%]Updating / installing...   1:screen-4.1.0-0.25.20120314git3c29################################# [100%

    3. 将中文man的路径写的man的配置文件

         gedit /etc/man_db.conf 增加一行,内容如下

         MANDATORY_MANPATH            /usr/share/man/zh_CN
     4.man -a ls  查看ls

[root@localhost ~]# man -a ls          LS(1)                User Commands               LS(1)NAME       ls - list directory contentsSYNOPSIS       ls [OPTION]... [FILE]...DESCRIPTION       List  information  about the FILEs (the current       directory by default).  Sort entries alphabeti‐       cally if none of -cftuvSUX nor --sort is speci‐       fied.

  q退出man命令

    man的使用

     f向下翻一页
     b向上翻一页
     d向下翻半页
     u向上翻半页
     ** G 跳至尾页
     ** g 跳至首页
     ** 搜索关键字
         /关键字  n 向下  N向上
         ?关键字  n 向上 
     q 退出man

    man的章节,man的关键字有多个文件与之匹配,则按类型,划分为以下9个章节

      * 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 章节号 关键字 (若省略章节号,则显示数字较小的章节)

    man -a 关键字   依次查看指定关键字的所有章节

[root@localhost ~]# man -a issue          ISSUE(5)       Linux Programmer's Manual      ISSUE(5)NAME       issue  -  prelogin  message  and identification       fileDESCRIPTION       The file /etc/issue is a text file  which  con‐       tains  a message or system identification to be       printed before the login prompt.  It  may  con‐       tain various @char and \char sequences, if sup‐       ported by the getty-type  program  employed  on       the system.FILES       /etc/issueSEE ALSO       motd(5), agetty(8), mingetty(8)

 

     man -w 关键字 查看关键字匹配到的第一个章节的来源文件

     man -aw 关键字 查看关键字匹配到的所有章节的来源文件
     man -f 关键字 等于 whatis 关键字

转载于:https://www.cnblogs.com/f-h-j-11-7/p/9311897.html

你可能感兴趣的文章
Delphi7编译的程序自动中Win32.Induc.a病毒的解决办法
查看>>
Objective-C 【关于导入类(@class 和 #import的区别)】
查看>>
倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)-点击运行按钮进入到运行状态报错Error starting TwinCAT System怎么办 AdsWarning1823怎么办...
查看>>
【转】javascript 中的很多有用的东西
查看>>
Centos7.2正常启动关闭CDH5.16.1
查看>>
Android 监听返回键、HOME键
查看>>
Android ContentProvider的实现
查看>>
sqlserver 各种判断是否存在(表名、函数、存储过程等)
查看>>
给C#学习者的建议 - CLR Via C# 读后感
查看>>
Recover Binary Search Tree
查看>>
Java 实践:生产者与消费者
查看>>
[转]IOCP--Socket IO模型终结篇
查看>>
(五)归一化
查看>>
使用信号量
查看>>
《数据分析实战》--第三章 python实现
查看>>
实验八 接口与实现接口的类
查看>>
PostgreSQL 保留关键字添加方法之一,不带参数的函数
查看>>
赛前热手 (天梯赛暴力题)
查看>>
Uva(10330)
查看>>
vlan学习
查看>>