跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 阅读 man 手册遇到的问题,粗体字如何使用?
未分類
16 2 月 2021

阅读 man 手册遇到的问题,粗体字如何使用?

阅读 man 手册遇到的问题,粗体字如何使用?

資深大佬 : lolcat 7

linux 用了这么多年,我发现我 man 手册还不会用。

我想查询 find 命令的正则表达式类型-regextype 选项的参数有哪些,man 手册介绍如下:

-regextype type

Changes the regular expression syntax understood by -regex and -iregex tests which occur later on the command line. To see which regular expression types are known, use -regextype help. The Texinfo documentation (see SEE ALSO) explains the meaning of and differences between the various types of regular expression.

其中-regextype help 是粗体的,所以我以为是告诉我使用

find -regextype help

命令,就能看到已知的正则表达式类型,但是我敲这个命令后,终端却提示我:

find -regextype help

find: Unknown regular expression type ‘help’; valid types are ‘findutils-default’, ‘awk’, ‘egrep’, ‘ed’, ‘emacs’, ‘gnu-awk’, ‘grep’, ‘posix-awk’, ‘posix-basic’, ‘posix-egrep’, ‘posix-extended’, ‘posix-minimal-basic’, ‘sed’.

help 是未知的参数,说明这个用法是错误的,虽然后面的提示告诉了我可以使用哪些参数,但 man 手册的原意肯定是通过 help 来获取详细正则表达式类型及其介绍的。

请问如果我想了解-regextype 后面的参数有哪些,及那些参数的含义,我该如何查找?

大佬有話說 (14)

  • 資深大佬 : lxilu

    这不告诉你了吗

  • 資深大佬 : lxilu

    The Texinfo documentation (see SEE ALSO) explains the meaning of and differences between the various types of regular expression.

  • 資深大佬 : omph

    ( see SEE ALSO )
    最下面的备注里有解释

  • 主 資深大佬 : lolcat

    @lxilu 谢谢,我看 SEE ALSO 部分用 info find 命令找到正则表达式类型了。请问 man 手册中的-regextype help 粗体字有啥含义? man 手册为啥要我使用-regextype help ?

  • 主 資深大佬 : lolcat

    @omph 谢谢,我看 SEE ALSO 部分用 info find 命令找到正则表达式类型了。请问 man 手册中的-regextype help 粗体字有啥含义? man 手册为啥要我使用-regextype help ?

  • 資深大佬 : lxilu

    应该只是占位

  • 資深大佬 : zlowly

    看 find 的源码里,只要 regextype 后的参数没有匹配到已知类型,就会报错。其中源码里的那段代码注释是
    We didn’t find a match for the type of regular expression that the user indicated they wanted. Tell them what the options are.
    所以理论上只要 regextype 后用任何非已知类型都能得到一样的信息,man 手册里可能只是为了用户方便记忆建议用 help 作为参数而已,无需做过多解读。

  • 資深大佬 : asahui

    只是单纯英文问题,其实这里的加粗而且不是像 markdown 里的`code` 这样,就是单纯提配你——去看-regextype 的 help,这里的 help 就是文档的意思,这句话不是叫你打`-regextype help`,而是查`-regextype`的 help

  • 資深大佬 : omph

    linux 是个自由的世界,包括命令的格式

  • 資深大佬 : feedcode

    恭喜你找到了一个文档的 bug,文档和行为不匹配

  • 資深大佬 : feedcode

    查了下最新的 4.8.0, 文档已经修正了
    https://git.savannah.gnu.org/cgit/findutils.git/plain/doc/find.texi
    http://www.gnu.org/software/findutils/manual/html%5Fmono/find.html#Full-Name-Patterns

  • 主 資深大佬 : lolcat

    @feedcode 请问你这看的网页是 info find 显示的结果吧?在哪看 4.8 版本的 man find 显示的结果?

  • 資深大佬 : feedcode

    good question.
    网页是从 doc/find.texi 生成的 ( Texinfo is the official documentation format of the GNU project )
    http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Adding-Output-Formats
    > From time to time, proposals are made to generate traditional Unix man pages from Texinfo source. However, because man pages have a strict conventional format, creating a good man page requires a completely different source from that needed for the typical Texinfo applications of writing a good user tutorial and/or a good reference manual. This makes generating man pages incompatible with the Texinfo design goal of not having to document the same information in different ways for different output formats. You might as well write the man page directly.

    find 的 man 应该是 https://git.savannah.gnu.org/cgit/findutils.git/plain/find/find.1 , 里面还是过时的信息,:(

  • 資深大佬 : IgniteWhite

    @feedcode 感谢。我看了这个帖子觉得主问的问题是有道理的,我也理解不了。上为文档的小错误辩解,我还以为我不会阅读了……

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具