Shell命令-线上查询及帮助之man、help
线上查询及帮助 - man、help
1、man:获取命令的帮助信息
man命令的简单介绍
man命令是Linux系统中最核心的命令之一 ,因为通过它可以查看其它Linux命令的使用信息。当然了 ,man命令不仅可以查看命令的使用帮助 ,还可以查看软件 服务配置文件、系统调用、库函数等的帮助信息。
man命令的功能说明
man命令用于查看命令的帮助信息。
man命令的语法格式
man[参数选项] 命令/文件
man命令的选项说明
man选项不常用,此处省略。
man命令的实践操作
范例1:使用man查看cp命令的帮助
[root@oldboyedu ~]# man cp <-->一般不加参数,直接跟命令
man命令其实用法很简单,关键就是帮助文档是英文版的,对于一些英文不是很好的学习者来说,简直跟天书似的,在此,我也无能为力,不过可以借助一些翻译工具等。也可以使用搜索引擎进行翻译。
表1:执行man命令后帮助内容中的标题介绍(大部分命令)
| man帮助信息中的标题 | 功能说明(带*为重点) |
|---|---|
| NAME | 命令说明及介绍(常见)* |
| SYNOPSIS | 命令的基本使用语法(常见)* |
| DESCRIPTION | 命令使用详细描述,以及相关参数说明(常用)* |
| OPTIONS | 命令相关参数选项说明 |
| COMMANDS | 在执行这个程序(软件)的时候,在此可执行 |
| FILES | 程序涉及(或使用或关联)的相关文件 |
| EXAMPLES | 命令的一些例子* |
| SEE ALSO | 和命令相关的信息说明 |
| BUGS (REPORTING BUGS) | 命令对应缺陷问题的描述 |
| COPYRIGHT | 版权信息相关声明 |
| AUTHOR | 作者介绍 |
表2:man帮助页面中的快捷键
| 操作键 | 功能说明 |
|---|---|
| [Page Down] | 向下翻一页(可用空格键替代) |
| [Page Up] | 向上翻一页 |
| [Home] | 跳转到第一页 |
| [End] | 跳转到最后一页 |
| /word | 向下依次查找word字符串(通常跟N或n键使用) |
| ?word | 向上依次查找word字符串(通常跟N或n键使用) |
| q | 结束本次man帮助 |
2、help:获取bash内置命令的帮助信息
help命令的简单介绍
在
Linux系统里有一些特殊的命令 ,它们就是bash程序的内置命令 ,例如cd、history、read等 ,这些命令在系统目录里不存在真实的程序文件(存在于bash程序里 ),对于这部分命令,查看帮助的方法就是使用help命令
help命令的实践操作
范例1:使用help查看cd命令
[root@oldboyedu ~]# help cd
cd: 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.
[root@oldboyedu ~]#
范例2:使用man查看cd命令
[root@oldboyedu ~]# man cd
BASH_BUILTINS(1) General Commands Manual BASH_BUILTINS(1)
==========================================================
**提示以下命令在bash里(CentOS7有的bash内置命令也可以使用man查询)**
==========================================================
NAME
bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen, complete, compopt, continue, declare, dirs,
disown, echo, enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout,
mapfile, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, true,
type, typeset, ulimit, umask, unalias, unset, wait - bash built-in commands, see bash(1)
BASH BUILTIN COMMANDS
Unless otherwise noted, each builtin command documented in this section as accepting options preceded by - accepts -- to
signify the end of the options. The :, true, false, and test builtins do not accept options and do not treat -- specially.
The exit, logout, break, continue, let, and shift builtins accept and process arguments beginning with - without requiring
--. Other builtins that accept arguments but are not specified as accepting options interpret arguments beginning with - as
invalid options and require -- to prevent this interpretation.
...
Shell命令-线上查询及帮助之man、help的更多相关文章
- Linux基本命令(6)线上查询的命令
线上查询的命令 命令 功能 man 查询和解释一个命令的使用方法,以及这个命令的说明事项 locate 定位文件和目录 whatis 寻找某个命令的含义 6.1 man命令 man命令用来查询和解释一 ...
- 150命令之线上查询及帮助命令 man hellp
150命令之线上查询及帮助命令 man 查询命令的帮助 man + 命令 NAME ls - list directory contents 命令+命令简单说明 SYNOPSIS ...
- shell 命令 grep -R 查询包含指定内容的文件
grep -R 举个栗子,在有上百个sql文件的目录下,查找使用 spark引擎 执行的文件. 代码是: grep -R spark ./* 返回的就是包含 spark 的sql文件名.
- 『003』Shell命令
『001』索引-Linux Shell Command shell命令 <01>[线上查询及帮助][001]-[001] [001]- 点我快速打开文章[man][help][已改版] & ...
- 如何在linux平台上编译安装zlib软件(公司部分线上机器缺少zlib不能安装supervisor)
文章在Centos 6.5 linux平台上演示一下如何进行编译安装zlib软件,并配置相关的选项加载使用.示范从下载到安装并配置进行使用过程一系列整套讲解,希望可以给网友考虑使用,谢谢. 工具 ...
- Java开发必须掌握的线上问题排查命令
作为一个合格的开发人员,不仅要能写得一手还代码,还有一项很重要的技能就是排查问题.这里提到的排查问题不仅仅是在coding的过程中debug等,还包括的就是线上问题的排查.由于在生产环境中,一般没办法 ...
- Java线上问题排查思路及Linux常用问题分析命令学习
前言 之前线上有过一两次OOM的问题,但是每次定位问题都有点手足无措的感觉,刚好利用星期天,以测试环境为模版来学习一下Linux常用的几个排查问题的命令. 也可以帮助自己在以后的工作中快速的排查线上问 ...
- Java架构师线上问题排查,这些命令程序员一定用得到!
Java架构师线上问题排查,这些命令程序员一定用得到! 线上问题排查,以下场景,你遇到过吗? 一.了解机器连接数情况 问题:1.2.3.4的sshd的监听端口是22,如何统计1.2.3.4的sshd服 ...
- 利用ganymed-ssh2远程执行其它Linux机器上的shell命令
实际应用中,有时候需要从web管理界面上,远程去启动其它linux主机上的程序,利用ssh协议可以方便的满足这一需求.事实上hadoop架构中,从nn上启动dn时,就是利用了免密码ssh登录.gany ...
随机推荐
- year 和 weak year 的区别
java 中使用 SimpleDateFormat 时,会遇到 year 和 week year 这两个概念,特此记录. google 答案: A week year is in sync with ...
- Android开发——Notification通知的各种Style详解
本来是想与之前讲解使用Notification通知使用一起写的,查看了资料,觉得有必要将这Style部分单独拿出来讲解 前篇:Android开发——Notification通知的使用及Notifica ...
- 微信公众平台设置URL和Token接收接口事件推送
最近做对接微信闪开发票-微信发票名片,里面有个接收用户提交抬头接口是微信推送事件到公众号后台,该事件将发送至开发者填写的URL(登录公众平台进入[开发者中心设置]). 开发者可通过事件推送完成数据统计 ...
- 利用scrollintoview方法模拟聊天室收到新消息
这段时间再写一个聊天的功能,基本的原理已经通了,剩下的就是细化功能和实现了.原理通了不代表就能解决了这个问题,今天就遇到了一个小问题,就是在接收到新的消息以后,最新的消息不能显示在消息区域,而是跑到了 ...
- Design Mobile实现国际化
参考:https://mobile.ant.design/components/locale-provider-cn/
- 【代码笔记】Web-CSS-CSS 链接(link)
一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- Cesium 之简介以及离线部署运行篇
前言 cesium 官网的api文档介绍地址cesium官网api,里面详细的介绍 cesium 各个类的介绍,还有就是在线例子:cesium 官网在线例子,这个也是学习 cesium 的好素材. C ...
- 关于ArcMap中打开ArcToolbox导致闪退的解决办法
最近好久不用ArcGis的小编要用到ArcMap去发送一个GP服务,发现按照套路打开ArcMap点击ArcToolbox时,发生了ArcMap的闪退现象,几经周折终于解决了问题. 希望也遇到这类问题的 ...
- Android 解析标准的点击第三方文件管理器中的视频的intent
解析标准的第三方视频intent private List<String> mCurPlayList = new ArrayList<String>(); private in ...
- 前端js面向对象编程以及封装组件的思想
demo-richbase 用来演示怎么使用richbase来制作组件的例子 作为一名前端工程师,写组件的能力至关重要.虽然javascript经常被人嘲笑是个小玩具,但是在一代代大牛的前仆后继的努力 ...