AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 795206
Accepted
daltonfury42
daltonfury42
Asked: 2016-07-06 09:20:17 +0800 CST2016-07-06 09:20:17 +0800 CST 2016-07-06 09:20:17 +0800 CST

如何有效地使用手册页?

  • 772

我期待掌握Linux。当您有疑问时,我一再被告知要参考手册页。

虽然我对命令行非常熟悉,但我发现很难快速有效地使用 man 来查找命令帮助。因此,我最终在谷歌上搜索如何完成工作。当我使用的系统无法访问互联网时,我会更加痛苦,我不得不走回办公室寻求互联网帮助。

一位大师如何操作手册页?可用于从手册页快速获取所需内容的最常见技巧是什么?最常用的键盘快捷键有哪些?

command-line
  • 3 3 个回答
  • 1131 Views

3 个回答

  • Voted
  1. Best Answer
    Kaz Wolfe
    2016-07-06T09:25:00+08:002016-07-06T09:25:00+08:00

    手册页本质上是美化的帮助文件。他们的目标是解释程序做什么,以及如何通过命令行标志和参数来改变他们做什么。

    如果您查看手册页的SYNOPSIS和OPTIONS部分,您通常能够充分了解您的程序的功能。

    不要让联机帮助页的“技术”措辞让您失望——它们通常是由开发人员以开发人员的心态编写的。您阅读/使用它们的次数越多,您将获得的越多,您就越会开发自己的使用技巧man。

    如果您按下 中的h键man,您可以获得许多有用的键盘快捷键(和一般帮助),这将使您的浏览(希望)更快。它们类似于 的击键less,因此它本质上是 2 换 1。

    而且,您可以随时参考man( man man) 的联机帮助页来快速了解man. 你不能破坏man得太严重,所以请随意尝试和尝试。

    • 4
  2. Terrance
    2016-07-06T09:50:58+08:002016-07-06T09:50:58+08:00

    我建议使用apropos来帮助更有效地搜索系统上的 man 文件。

    apropos可以搜索与其中匹配的单词的所有内容,也可以使用-e开关查找特定的。

    以下示例:

    terrance@terrance-Linux:~$ apropos reboot
    grub-reboot (8)      - set the default boot entry for GRUB, for the next boot...
    halt (8)             - Halt, power-off or reboot the machine
    poweroff (8)         - Halt, power-off or reboot the machine
    reboot (2)           - reboot or enable/disable Ctrl-Alt-Del
    reboot (8)           - Halt, power-off or reboot the machine
    rescan-scsi-bus.sh (8) - script for adding and removing SCSI devices without ...
    shutdown (8)         - Halt, power-off or reboot the machine
    systemd-reboot.service (8) - System shutdown logic
    

    或者...

    terrance@terrance-Linux:~$ apropos -e reboot
    halt (8)             - Halt, power-off or reboot the machine
    poweroff (8)         - Halt, power-off or reboot the machine
    reboot (2)           - reboot or enable/disable Ctrl-Alt-Del
    reboot (8)           - Halt, power-off or reboot the machine
    shutdown (8)         - Halt, power-off or reboot the machine
    

    正如您在上面看到的,我通过搜索命令得到了两个不同的命令列表reboot。中的数字( )是节号。该命令reboot列出了 2 个不同的数字。任何不重复的行,只需要 do man <command>,不需要节号。

    要打开该部分,它将是以下命令:

    man 2 reboot
    

    这将返回此手册页:

    REBOOT(2)                  Linux Programmer's Manual                 REBOOT(2)
    
    NAME
           reboot - reboot or enable/disable Ctrl-Alt-Del
    
    SYNOPSIS
           /* For libc4 and libc5 the library call and the system call
              are identical, and since kernel version 2.1.30 there are
              symbolic names LINUX_REBOOT_* for the constants and a
              fourth argument to the call: */
    
           #include <unistd.h>
           #include <linux/reboot.h>
    
           int reboot(int magic, int magic2, int cmd, void *arg);
    
           /* Under glibc and most alternative libc's (including uclibc, dietlibc,
              musl and a few others), some of the constants involved have gotten
              symbolic names RB_*, and the library call is a 1-argument
              wrapper around the 3-argument system call: */
    
           #include <unistd.h>
    

    或者

    man 8 reboot
    

    这将返回此手册页:

    HALT(8)                              halt                              HALT(8)
    
    NAME
           halt, poweroff, reboot - Halt, power-off or reboot the machine
    
    SYNOPSIS
           halt [OPTIONS...]
    
           poweroff [OPTIONS...]
    
           reboot [OPTIONS...]
    
    DESCRIPTION
           halt, poweroff, reboot may be used to halt, power-off or reboot the
           machine.
    
    OPTIONS
           The following options are understood:
    
           --help
               Print a short help text and exit.
    
           --halt
    

    截断上面的空间示例。


    希望这可以帮助!

    • 3
  3. Colin Ian King
    2016-07-06T09:41:01+08:002016-07-06T09:41:01+08:00

    也可以使用man -k(或apropos) 查找与手册的简短描述部分中的文本匹配的手册页,例如:

    apropos directory
    

    ..将在手册的简短描述部分中找到所有带有“目录”的手册页。

    • 1

相关问题

  • 如何从命令行仅安装安全更新?关于如何管理更新的一些提示

  • 如何从命令行刻录双层 dvd iso

  • 如何从命令行判断机器是否需要重新启动?

  • 文件权限如何工作?文件权限用户和组

  • 如何在 Vim 中启用全彩支持?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve