shell - 到达正确的手册页
问题描述
当我在 shell 提示符下键入“man read”时,它会显示 read shell 命令,我如何打开 read() C 函数的文档。我的问题不仅适用于 read 适用于类似的其他功能,例如 sleep()
当它发生时,我通常会跑到https://linux.die.net并在那里参考文档,我相信有办法从 shell 提示符本身进入正确的手册页
解决方案
man <section #> <page>
从手册页:
The table below shows the section numbers of the manual followed by the types of pages they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
要查找给定页面存在哪些部分,您可以使用以下-k
标志:
$ man -k ^sleep$
sleep (1) - delay for a specified amount of time
sleep (3) - sleep for a specified number of seconds
推荐阅读
- image - 如何最好地优化带有图像的 React Web 应用程序的初始页面加载,尤其是对于移动设备?
- encryption - 如何从已知密码的死手机中解密apk加密文件?
- prestashop-1.7 - Prestashop 更改 CSS 的优先级
- javascript - Vuejs 的自定义点击跟踪
- python - 数据帧 apply() 真的比数据帧 itertuples() 慢吗?
- ruby-on-rails - 在updated_all的情况下如何处理乐观锁定?
- django - /poll/poll/result.html 中的 TemplateDoesNotExist
- python-2.7 - AttributeError:“NoneType”对象没有属性“文本”ElementTree Python
- java - 如何从关系中仅检索属性而不是实体?
- javascript - 使用 Jest 模拟在 vue 组件中导入的模块