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 ...
随机推荐
- vb.net連接SQL数据库
'導入命名空間Imports System.Data.SqlClient '定義變量 Dim Sql As String 'SQL字串 Dim Sqlado As SqlConnection '连接数 ...
- 微信公众平台设置URL和Token接收接口事件推送
最近做对接微信闪开发票-微信发票名片,里面有个接收用户提交抬头接口是微信推送事件到公众号后台,该事件将发送至开发者填写的URL(登录公众平台进入[开发者中心设置]). 开发者可通过事件推送完成数据统计 ...
- ASP.NET Core介绍
认识ASP.NET Core ASP.NET Core是一个跨平台,高性能,开源的框架,用于构建现代,基于云的网络应用程序,使用ASP.NET Core可以实现: 开发web应用,服务,IoT应用和移 ...
- Node.js面试题之2017
译者按: 从ECMAScript标准,Node.js语法以及NPM模块角度来看,Node.js的发展让人目不暇接,那么面试题也得与时俱进. 原文: Node.js Interview Question ...
- sublime前端必备插件
1,docblockr javascr 和 CSS快捷注释插件 在javascript中 写出函数后,/**+回车 就会出现下面函数注释补全. -----/** * @param {[typ ...
- js知识点总结
组成 ECMAscript 基础语法 变量 数据类型 运算符 数组 函数 对象BOM 浏览器对象模型 window对象(获取浏览器宽高) history对象 locat ...
- 编写高性能.NET程序-《Concurrency in .NET》(1)- 为什么要读这本书?
最近广州.NET微软技术俱乐部对如何编写高性能.NET程序发起了讨论. 首先是在ORM和SQL方面进行了讨论,主题当然是经久不衰的月经贴: EF性能很差. Edi.Wang专门写了一篇文章< ...
- Android BottomNavigationBar导航栏
基本属性 setActiveColor //选中item的字体颜色 setInActiveColor //未选中Item中的颜色 setBarBackgroundColor//背景颜色 setMode ...
- selenium2 run in Jenkins GUI testing not visible or browser not open but run in background浏览器后台运行不可见
http://wiki.hudson-ci.org/display/HUDSON/Tomcat Tomcat from Windows GUI Testing in Windows Most Wi ...
- C# List集合去重使用lambda表达式
name age sex Lucy 22 woman Lily 23 woman Tom 24 man Lucy 22 woman Lily 23 woman LiLei 25 man List< ...