Linux帮助命令

外置帮助(很棒)


帮助命令:man



[root@localhost 桌面]# #第一行name 简单介绍类这个命令
[root@localhost 桌面]# #man命令下  /可以查找


[root@localhost 桌面]# man services  # 千万别打绝对路径
Cannot open the message catalog "man" for locale "zh_CN.utf8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")

Formatting page, please wait...
[root@localhost 桌面]# 

[root@localhost 桌面]# man passwd
[root@localhost 桌面]# man passwd #直接回车后 输出的结果不是我们想要的
[root@localhost 桌面]# whereis passwd
passwd: /usr/bin/passwd /etc/passwd /usr/share/man/man5/passwd.5.gz /usr/share/man/man1/passwd.1.gz
[root@localhost 桌面]# #我们可以看到 有好几个passwd  是因为passwd有一个命令 也有一个文件 名字中包括了1 和5
[root@localhost 桌面]# man passwd #1命令的帮助  (默认是1)5配置文件的帮助 

[root@localhost 桌面]# man 5 passwd 
[root@localhost 桌面]# #这样就可以看到我们想看到的了


<span style="font-size:14px;">[root@localhost 桌面]# whatis ls
ls                   (1)  - list directory contents
ls                   (1p)  - list directory contents
[root@localhost 桌面]# #只获得man命令name那一行信息
</span>

<span style="font-size:14px;">[root@localhost 桌面]# apropos services
authconfig-gtk       (8)  - GUI utility for configuring user identity and system authentication services
chkconfig            (8)  - updates and queries runlevel information for system services
endservent [getservent] (3p)  - network services database functions
fingerprint-auth-ac [system-auth-ac] (5)  - Common configuration files for PAMified services written by authconfig(8)
getservbyname [getservent] (3p)  - network services database functions
getservbyport [getservent] (3p)  - network services database functions
getservent           (3p)  - network services database functions
munin_services_plugin_selinux (8)  - Security Enhanced Linux Policy for the munin_services_plugin processes
nagios_services_plugin_selinux (8)  - Security Enhanced Linux Policy for the nagios_services_plugin processes
pam_listfile         (8)  - deny or allow services based on an arbitrary file
password-auth-ac [system-auth-ac] (5)  - Common configuration files for PAMified services written by authconfig(8)
rtas                 (2)  - Allows userspace to call RTAS (Run Time Abstraction Services)
services             (5)  - Internet network services list
setservent [getservent] (3p)  - network services database functions
smartcard-auth-ac [system-auth-ac] (5)  - Common configuration files for PAMified services written by authconfig(8)
sssd                 (8)  - System Security Services Daemon
system-auth          (5)  - Common configuration file for PAMified services
system-auth-ac       (5)  - Common configuration files for PAMified services written by authconfig(8)
system-config-authentication [authconfig-gtk] (8)  - GUI utility for configuring user identity and system authentication services
system-config-services (8)  - Service Configuration Utility
tcpd                 (8)  - access control facility for internet services
[root@localhost 桌面]# #只查看配置文件的信息
</span>


帮助命令:help




[root@localhost 桌面]# ls --help
用法:ls [选项]... [文件]...
列出 FILE 的信息(默认为当前目录)。
如果不指定-cftuvSUX 或--sort 选项,则根据字母大小排序。

长选项必须使用的参数对于短选项时也是必需使用的。
  -a, --all			不隐藏任何以. 开始的项目
  -A, --almost-all		列出除. 及.. 以外的任何项目
      --author			与-l 同时使用时列出每个文件的作者
  -b, --escape			以八进制溢出序列表示不可打印的字符
      --block-size=大小		块以指定大小的字节为单位
  -B, --ignore-backups		不列出任何以"~"字符结束的项目
  -c				配合-lt:根据ctime 排序并显示ctime(文件
				状态最后更改的时间)
				配合-l:显示ctime 但根据名称排序				其他情况:按ctime 排序
  -C				每栏由上至下列出项目
      --color[=WHEN]		控制是否使用色彩分辨文件。WHEN 可以是
				"never"(默认)、"always"或"auto"其中之一
  -d, --directory		当遇到目录时列出目录本身而非目录内的文件
  -D, --dired			产生适合Emacs 的dired 模式使用的结果
  -f				不进行排序,-aU 选项生效,-lst 选项失效
  -F, --classify		加上文件类型的指示符号(*/=@| 其中一个)
      --format=关键字		交错-x,逗号分隔-m,水平-x,长-l,
				单栏-1,详细-l,垂直-C
      --full-time		即-l --time-style=full-iso
  -g				类似-l,但不列出所有者
      --group-directories-first
			在文件前分组目录。此选项可与--sort 一起使用,
			但是一旦使用--sort=none (-U)将禁用分组
  -G, --no-group		以一个长列表的形式,不输出组名
  -h, --human-readable		与-l 一起,以易于阅读的格式输出文件大小
				(例如 1K 234M 2G)
      --si			同上面类似,但是使用1000 为基底而非1024
  -H, --dereference-command-line
				跟随命令行列出的符号链接
      --dereference-command-line-symlink-to-dir
				跟随命令行列出的目录的符号链接
      --hide=PATTERN         	隐藏符合PATTERN 模式的项目
				(-a 或 -A 将覆盖此选项)
      --indicator-style=方式	指定在每个项目名称后加上指示符号方式:
				none (默认),classify (-F),file-type (-p)
  -i, --inode			显示每个文件的inode 号
  -I, --ignore=PATTERN		不显示任何符合指定shell PATTERN 的项目
  -k				即--block-size=1K
  -l				使用较长格式列出信息
  -L, --dereference		当显示符号链接的文件信息时,显示符号链接所指示
				的对象而并非符号链接本身的信息
  -m				所有项目以逗号分隔,并填满整行行宽
  -n, --numeric-uid-gid		类似 -l,但列出UID 及GID 号
  -N, --literal			输出未经处理的项目名称 (如不特别处理控制字符)
  -o				类似 -l,但不列出有关组的信息
  -p,  --indicator-style=slash	对目录加上表示符号"/"
  -q, --hide-control-chars	以"?"字符代替无法打印的字符
      --show-control-chars	直接显示无法打印的字符 (这是默认方式,除非调用
				的程序名称是"ls"而且是在终端输出结果)
  -Q, --quote-name		将条目名称括上双引号
      --quoting-style=方式	使用指定的quoting 方式显示条目的名称:
				literal、locale、shell、shell-always、c、escape
  -r, --reverse			排序时保留顺序
  -R, --recursive		递归显示子目录
  -s, --size			以块数形式显示每个文件分配的尺寸
  -S				根据文件大小排序
      --sort=WORD		以下是可选用的WORD 和它们代表的相应选项:
				extension -X       status   -c
				none      -U       time     -t
				size      -S       atime    -u
				time      -t       access   -u
				version   -v       use      -u
      --time=WORD		和-l 同时使用时显示WORD 所代表的时间而非修改时
				间:atime、access、use、ctime 或status;加上
				--sort=time 选项时会以指定时间作为排序关键字
      --time-style=STYLE	和-l 同时使用时根据STYLE 代表的格式显示时间:
				full-iso、iso、locale、posix-iso、+FORMAT。
				FORMAT 即是"date"所用的时间格式;如果FORMAT
				是FORMAT1<换行>FORMAT2,FORMAT1 适用于较旧
				的文件而FORMAT2 适用于较新的文件;如果STYLE
				以"posix-"开头,则STYLE 仅在POSIX 语系之外
				生效。
  -t				根据修改时间排序
  -T, --tabsize=宽度	指定制表符(Tab)的宽度,而非8 个字符
  -t			按修改时间排序
  -T, --tabsize=COLS	指定制表符(Tab)的宽度,而非8个字符
  -u			同-lt 一起使用:按照访问时间排序并显示
			同-l一起使用:显示访问时间并按文件名排序
			其他:按照访问时间排序
  -U			不进行排序;按照目录顺序列出项目
  -v			在文本中进行数字(版本)的自然排序
  -w, --width=COLS           assume screen width instead of current value
  -x                         list entries by lines instead of by columns
  -X                         sort alphabetically by entry extension
  -1                         list one file per line

SELinux options:

  --lcontext                 Display security context.   Enable -l. Lines
                             will probably be too wide for most displays.
  -Z, --context              Display security context so it fits on most
                             displays.  Displays only mode, user, group,
                             security context and file name.
  --scontext                 Display only security context and file name.
      --help		显示此帮助信息并退出
      --version		显示版本信息并退出

SIZE 可以是一个可选的整数,后面跟着以下单位中的一个:
KB 1000,K 1024,MB 1000*1000,M 1024*1024,还有 G、T、P、E、Z、Y。

使用色彩来区分文件类型的功能已被禁用,默认设置和 --color=never 同时禁用了它。
使用 --color=auto 选项,ls 只在标准输出被连至终端时才生成颜色代码。
LS_COLORS 环境变量可改变此设置,可使用 dircolors 命令来设置。


退出状态:
 0  正常
 1  一般问题 (例如:无法访问子文件夹)
 2  严重问题 (例如:无法使用命令行参数)

请向bug-coreutils@gnu.org 报告ls 的错误
GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
请向<http://translationproject.org/team/zh_CN.html> 报告ls 的翻译错误
要获取完整文档,请运行:info coreutils 'ls invocation'
[root@localhost 桌面]# #几乎所有命令都支持这个选项







[root@localhost 桌面]# help cd #这个显示shell内置命令的帮助  man命令对内置命令无效
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 without following symbolic
    	links
    
    The default is to follow symbolic links, as if `-L' were specified.
    
    Exit Status:
    Returns 0 if the directory is changed; non-zero otherwise.
[root@localhost 桌面]# 


总结


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值