Linux下的三大帮助命令man、help、info

man

  • 使用方法 man [参数] 命令
# 查看man 命令本身

man man    

输出内容样例:

NAME
       man - an interface to the on-line reference manuals

SYNOPSIS
       man  [-C  file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-m system[,...]] [-M path] [-S list]
       [-e extension] [-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P pager] [-r prompt]  [-7]
       [-E  encoding] [--no-hyphenation] [--no-justification] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z]
       [[section] page[.section] ...] ...
       man -k [apropos options] regexp ...
       man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
       man -f [whatis options] page ...
       man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-P  pager]  [-r  prompt]  [-7]  [-E
       encoding] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] file ...
       man -w|-W [-C file] [-d] [-D] page ...
       man -c [-C file] [-d] [-D] page ...
       man [-?V]
  • 切换中文版本

    因为man提供的原版本为英文版,对英文不好的人员不太友好,下面我通过以ubuntu为例子做修改。其他版本的Linux可以自行去查阅相关方法;

    • 下载中文版本
    apt-get install manpages-zh
    
    • 修改配置文件 etc/manpath.config

      将系统中原来配置文件中的的/usr/share/man替换为/usr/share/man/zh_CN

    # 打开配置文件
    vim  /etc/manpath.config
    # 路径替换
    :1,$s#/usr/share/man#/usr/share/man/zh_CN#g
    
    • 结果
    名称
           man - 在线参考手册的接口
    
    概述
           man  [-C  文件]  [-d]  [-D] [--warnings[=警告]] [-R 编码] [-L 区域] [-m 系统[,...]] [-M 路径] [-S 列表] [-e 扩展]
           [-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P 分页程序]  [-r  提示]  [-7]  [-E  编码]
           [--no-hyphenation]  [--no-justification]  [-p  字符串] [-t] [-T[设备]] [-H[浏览器]] [-X[dpi]] [-Z] [[章节][.章
           节] ...] ...
           man -k [apropos 选项] 正则表达式 ...
           man -K [-w|-W] [-S list] [-i|-I] [--regex] [章节] 词语 ...
           man -f [whatis 选项]...
           man -l [-C 文件] [-d] [-D] [--warnings[=警告]] [-R 编码] [-L 区域] [-P 分页程序] [-r 提示] [-7] [-E 编码] [-p  字
           符串] [-t] [-T[设备]] [-H[浏览器]] [-X[dpi]] [-Z] 文件 ...
           man -w|-W [-C 文件] [-d] [-D]...
           man -c [-C 文件] [-d] [-D]...
           man [-?V]
    

help

  • 使用方法

    • 命令 --help作用于外部命令;
    ls --help
    
    • help 命令 作用于内部命令;
    help cd 
    

    内外部命令可以通过type 命令的方式查看;

    type cd 
    cd is a shell builtin
    
    type ls
    ls is aliased to `ls --color=auto'
    

    根据以上结果可以知道cd是内部命令,ls就是外部命令了.

info

  • 使用方式
    • info 命令

info是更为详细的命令解释,不怎么常用。


分享是最好的学习!

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值