常用 Linux 基础命令使用方法

本文详细介绍了Linux系统中常见的基础命令,包括help、enable、whereis、which、type、hash、alias、unalias、date、hwclock、poweroff、halt、shutdown、reboot、whoami、who、w、screen、echo和history的使用方法和示例,帮助用户更好地掌握Linux操作。
摘要由CSDN通过智能技术生成
1、help

功能: 用于显示 shell 内部命令的帮助信息。

语法格式: help [-dms] [pattern …]

常用参数:

参数 作用
-d 显示内部命令的简要描述。
-m 按照 man 手册的格式输出内部命令的帮助信息。
-s 仅输出内部命令的命令格式。

示例:

  • 显示所有内部命令。
[yinxd@localhost ~]$ help
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                               history [-c] [-d offset] [n] or history -anrw [filename>
 (( expression ))                           if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMA>
 . filename [arguments]                     jobs [-lnprs] [jobspec ...] or jobs -x command [args]
 :                                          kill [-s sigspec | -n signum | -sigspec] pid | jobspec >
 [ arg... ]                                 let arg [arg ...]
 [[ expression ]]                           local [option] name[=value] ...
----以下省略----
  • 显示 help 命令的帮助信息。
[yinxd@localhost ~]$ help help
help: help [-dms] [pattern ...]
    Display information about builtin commands.
    
    Displays brief summaries of builtin commands.  If PATTERN is
    specified, gives detailed help on all commands matching PATTERN,
    otherwise the list of help topics is printed.
    
    Options:
      -d	output short description for each topic
      -m	display usage in pseudo-manpage format
      -s	output only a short usage synopsis for each topic matching
    	PATTERN
    
    Arguments:
      PATTERN	Pattern specifiying a help topic
    
    Exit Status:
    Returns success unless PATTERN is not found or an invalid option is given.
  • 显示 help 命令的简要描述。
[yinxd@localhost ~]$ help -d help
help - Display information about builtin commands.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值