金鱼哥戏说RHCSA认证:六、在Linux中获取帮助

简介: 第六章 在Linux中获取帮助
🎹 个人简介:大家好,我是 金鱼哥,CSDN运维领域新星创作者,华为云·云享专家,阿里云社区·专家博主
📚个人资质: CCNA、HCNP、CSNA(网络分析师),软考初级、中级网络工程师、RHCSA、RHCE、RHCA、RHCI、ITIL😜
💬格言:努力不一定成功,但要想成功就必须努力🔥

🎈支持我:可点赞👍、可收藏⭐️、可留言📝


本章节介绍如何从在Linux中获取帮助。善用帮助来查询相关信息能让工作中事半功倍。

📜6.1 查看命令的帮助

📑6.1.1 内部命令帮助

  • help COMMAND
  • man bash

范例:

[root@servera ~]# type history
history is a shell builtin
[root@servera ~]# help history 
history: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
    Display or manipulate the history list.
    
    Display the history list with line numbers, prefixing each modified
    entry with a `*'.  An argument of N lists only the last N entries.
    
    Options:
      -c    clear the history list by deleting all of the entries
      -d offset    delete the history entry at position OFFSET.
    
      -a    append history lines from this session to the history file
      -n    read all history lines not already read from the history file
            and append them to the history list
      -r    read the history file and append the contents to the history
            list
      -w    write the current history to the history file
    
      -p    perform history expansion on each ARG and display the result
            without storing it in the history list
      -s    append the ARGs to the history list as a single entry
    
    If FILENAME is given, it is used as the history file.  Otherwise,
    if HISTFILE has a value, that is used, else ~/.bash_history.
    
    If the HISTTIMEFORMAT variable is set and not null, its value is used
    as a format string for strftime(3) to print the time stamp associated
    with each displayed history entry.  No time stamps are printed otherwise.
    
    Exit Status:
    Returns success unless an invalid option is given or an error occurs.

📑6.1.2 外部命令和软件帮助

  • COMMAND --help 或 COMMAND -h
  • 使用 man 手册(manual): man COMMAND
  • 信息页:info COMMAND
  • 程序自身的帮助文档:README、INSTALL、ChangeLog
  • 程序官方文档
  • 相关网站 CSDN
  • 搜索引擎 百度,谷歌

📜6.2 --help 或 -h 选项

显示用法总结和参数列表,大多数命令使用,但并非所有的

范例:

[root@servera ~]# date --help
Usage: date [OPTION]... [+FORMAT]
  or:  date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display the current time in the given FORMAT, or set the system date.

Mandatory arguments to long options are mandatory for short options too.
  -d, --date=STRING          display time described by STRING, not 'now'

[root@servera ~]# cal -h

Usage:
 cal [options] [[[day] month] year]
 cal [options] <timestamp|monthname>

Display a calendar, or some part of it.
Without any arguments, display the current month.

📜6.3 man命令

man 提供命令帮助的文件,手册页存放在/usr/share/man
几乎每个命令都有man的“页面”
中文man需安装包

  • man-pages
  • man-pages-zh-CN

man章节

man 页面分组为不同的“章节”,统称为Linux手册,man 1 man

  • 1:用户命令
  • 2:系统调用
  • 3:C库调用
  • 4:设备文件及特殊文件
  • 5:配置文件格式
  • 6:游戏
  • 7:杂项
  • 8:管理类的命令
  • 9:Linux 内核API

查看man手册

man [章节] keyword

man page 导航

image-20210325195735040

阅读man page

标题

  • Name 主题名称。通常是命令或文件名。非常简短的描述。
  • SYNOPSIS 命令语法的概要
  • DESCRIPTION 提供对主题的基本理解的深度描述
  • OPTIONS 命令执行选项说明
  • EXAMPLES 有关如何使用命令、功能或文件的示例。
  • FLIES 与 man page 相关的文件和目录的列表
  • BUGS 软件中的已知错误

man 常用选项

mandb 更新whatis数据库
  • 列出所有帮助

    man -a keyword
  • 搜索man手册

    #列出所有匹配的页面,使用 whatis 数据库
    man -k keyword
  • 相当于 whatis

    man -f keyword
  • 打印man帮助文件的路径

    man -w [章节] keyword

📜6.4 info

man常用于命令参考 ,GNU工具 info 适合通用文档参考
没有参数,列出所有的页面
info 页面的结构就像一个网站
每一页分为“节点”
链接节点之前

info 命令格式

info [命令]

导航info页

  • 方向键,PgUp,PgDn 导航
  • U 返回父链接
  • D 返回首页

💡总结

  • 介绍文件系统目录结构。
  • 介绍Linux下的文件类型。
  • 介绍文件操作命令。
  • 介绍文件元数据和节点表结构。
  • 介绍文件系统目录结构。
  • 介绍Linux下的文件类型。
  • 介绍文件操作命令。
  • 介绍文件元数据和节点表结构。

RHCSA认证作为基础认证,涉及的基础内容需要大家好好进行学习并巩固。有良好的基础才能更上一层楼。
好好加油,可以噶🤪。

以上就是【金鱼哥】对 第六章 在Linux中获取帮助 的简述和讲解。希望能对看到此文章的小伙伴有所帮助。

💾 红帽认证专栏系列:
RHCSA专栏: 戏说 RHCSA 认证
RHCE专栏: 戏说 RHCE 认证
此文章收录在RHCA专栏: RHCA 回忆录

如果这篇【文章】有帮助到你,希望可以给【金鱼哥】点个赞👍,创作不易,相比官方的陈述,我更喜欢用【通俗易懂】的文笔去讲解每一个知识点。

如果有对【运维技术】感兴趣,也欢迎关注❤️❤️❤️ 【金鱼哥】❤️❤️❤️,我将会给你带来巨大的【收获与惊喜】💕💕!

目录
相关文章
|
1月前
|
运维 监控 安全
在Linux系统中,认证日志
Linux系统中的认证日志对于安全监控和故障排查至关重要,常见的日志文件包括:`/var/log/auth.log`(Debian、Ubuntu)、`/var/log/secure`(RPM发行版)、`/var/log/lastlog`、`/var/log/faillog`、`/var/log/wtmp`和`/var/run/utmp`。这些文件记录登录尝试、失败、当前用户等信息。日志管理可通过文本编辑器、日志查看工具或`rsyslog`、`syslog-ng`等工具进行。注意日志位置可能因发行版和配置差异而变化,应确保日志文件的安全访问,并定期轮转归档以保护敏感信息和节省空间。
26 3
|
14天前
|
存储 安全 Linux
【专栏】RHCSA认证考试(EX200)聚焦Linux用户和组管理,涉及基本概念、命令及管理策略。
【4月更文挑战第28天】RHCSA认证考试(EX200)聚焦Linux用户和组管理,涉及基本概念、命令及管理策略。理解用户与组、根用户与普通用户、标准组与附加组的区别至关重要。关键文件包括`/etc/passwd`、`/etc/group`、`/etc/shadow`和`/etc/gshadow`。熟悉`useradd`、`passwd`、`groupadd`等命令以及权限管理工具如`chown`和`chmod`。遵循最小特权原则,定期审计账户,实施密码策略,并利用自动化工具提升效率。掌握这些知识将助力考生在RHCSA考试中表现出色,并在实际工作中有效管理Linux系统。
|
2月前
|
存储 运维 网络协议
Linux SSHD服务安装与维护详解(一)——SSHD安装、启动与密钥认证实现
Linux SSHD服务安装与维护详解(一)——SSHD安装、启动与密钥认证实现
62 2
|
10月前
|
Linux 虚拟化
rhcsa基础和Linux环境搭建以及简单命令使用
rhcsa基础和Linux环境搭建以及简单命令使用
66 0
|
10月前
|
Linux 网络安全 数据安全/隐私保护
Linux 使用ssh密钥认证方式登陆另一台linux服务器
Linux 使用ssh密钥认证方式登陆另一台linux服务器
|
11月前
|
Linux Android开发
支付宝二维码脱机认证库测试(linux_x86平台验证)
支付宝二维码脱机认证库测试(linux_x86平台验证)
|
Linux 开发工具 文件存储
Elastic认证考试:考试常用Linux命令合集,0基础必看
Elastic认证考试:考试常用Linux命令合集,0基础必看
|
Linux 网络安全 数据安全/隐私保护
|
1天前
|
安全 网络协议 Linux
linux必学的60个命令
Linux是一个功能强大的操作系统,提供了许多常用的命令行工具,用于管理文件、目录、进程、网络和系统配置等。以下是Linux必学的60个命令的概览,但请注意,这里可能无法列出所有命令的完整语法和选项,仅作为参考
|
1天前
|
监控 Linux 数据处理