• 如何查找linux指令或者资料的说明


    如何查找linux指令或者资料的说明

    例子:查找printf的用法说明

    1. 先用 whatis printf 查看printf相关的信息(也可以用man -f printf,man --help中有介绍,两种方式一样)
    ubuntu@VM-16-16-ubuntu:~$ whatis printf
    printf (1)           - format and print data
    printf (3)           - formatted output conversion
    
    • 1
    • 2
    • 3

    可以看到返回的内容:命令名称+命令在man手册中的章节+简述命令或函数的作用
    小贴士:可以通过man man 查看到man手册9个章节的含义

      1   Executable programs or shell commands				
      2   System calls (functions provided by the kernel)
      3   Library calls (functions within program libraries)      #一些常用函数库,大部分为C函数库
      4   Special files (usually found in /dev)
      5   File formats and conventions, e.g. /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]
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    1. 要查找shell命令printf的详细说明,选择man手册的第一章 man 1 printf查看,当然也可以直接printf --help
      要查找C语言printf库函数的用法,选择man手册的第三章 man 3 printf查看

    2. 如果要查找的指令或者函数名称包含printf,可以使用man -k printf(等价于apropos printf)

    ubuntu@VM-16-16-ubuntu:~$ man -k printf
    asprintf (3)         - print to allocated string
    dprintf (3)          - formatted output conversion
    fprintf (3)          - formatted output conversion
    fwprintf (3)         - formatted wide-character output conversion
    printf (1)           - format and print data
    printf (3)           - formatted output conversion
    snprintf (3)         - formatted output conversion
    sprintf (3)          - formatted output conversion
    swprintf (3)         - formatted wide-character output conversion
    vasprintf (3)        - print to allocated string
    vdprintf (3)         - formatted output conversion
    vfprintf (3)         - formatted output conversion
    vfwprintf (3)        - formatted wide-character output conversion
    vprintf (3)          - formatted output conversion
    vsnprintf (3)        - formatted output conversion
    vsprintf (3)         - formatted output conversion
    vswprintf (3)        - formatted wide-character output conversion
    vwprintf (3)         - formatted wide-character output conversion
    wprintf (3)          - formatted wide-character output conversion
    XtAsprintf (3)       - memory management functions
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    参考资料

    4.3 Linux系統的線上求助man page與info page
    Linux中man手册的使用 ——以CentOS6.8为例

  • 相关阅读:
    CPU上下文切换
    数字先锋 | 教育资源乘云而来!46万城乡学子共享名师课堂
    零代码编程:用ChatGPT批量采集bookroo网页上的英文书目列表
    前端学习笔记(4) Vue3 全局属性 app.config.globalProperties 使用案例
    Reading Note(10)——AutoBridge
    智能化水库监控,水库雨情在线监控系统解决方案
    爬虫异常处理实战:应对请求频率限制和数据格式异常
    k8s简介以及各个组件
    ElasticSearch集群的搭建
    宝塔安装rabbitMQ实战
  • 原文地址:https://blog.csdn.net/qq_43577613/article/details/126901272