Linux的命令帮助

1)help查看内部命令的帮助(cd、pwd)
2)查看各种man手册页的存放路径
3)查阅以下命令的man手册页:uname、ifconfig、cat、shutdown
4)用man查看文件/etc/passwd的帮助信息

当利用help命令,查看命令的帮助信息时候。注意两种格式:
help 内部命令
外部命令 --help
man命令可以查看命令的帮助信息,而且帮助信息的类型有很多种,也可以说man帮助手册有很多的入口:1 用户指令、2 系统、3 程序库、4 设备、5 文件系统、6 游戏、7 杂项、8 系统指令、9 内核指令。
其中1、5、8常用需要重点记忆。
步骤
实现此案例需要按照如下步骤进行。

步骤一:help查看内部命令的帮助(cd、pwd)

命令操作如下所示:

[root@localhost ~]# help cd
cd: cd [-L|-P] [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 w

……

步骤二:查看各种man手册页的存放路径

其实man命令显示的帮助信息,其原理是把事先写好的帮助文档显示出来而已。那么这些帮助文档在哪里呢?,可以通过命令manpath来查看,命令操作如下所示:
[root@localhost ~]# manpath //有多个路径,冒号为分隔符
/usr/local/share/man:/usr/share/man/zh_CN:/usr/share/man/overrides:/usr/share/man
步骤三:用man命令查看一下命令(uname、ifconfig、cat、shutdown)
man命令显示结果一般较多,我们简单了解即可。重点是man命令的使用。命令操作如下所示:

[root@localhost ~]# man uname   			//按q键退出
……
[root@localhost ~]# man ifconfig
……

[root@localhost ~]# man cat
……

[root@localhost ~]# man shutdown
……

步骤四:用man查看文件/etc/passwd帮助信息

需要大家记住的几个man入口:1(用户指令)、5(文件系统)、8(系统指令)。而/etc/passwd为文件,属于文件系统5的范畴,所以命令操作如下所示:

[root@localhost ~]# man 5 /etc/passwd
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值