介绍

Linux提供了一个帮助手册,可以供使用者进行查询。

格式

man 代号 数据

1 使用者在shell中可以操作的指令或可执行档
2 系統核心可呼叫的函数与工具等
3 一些常用的函数(function)与函数库(library),大部分是C的函数库(libc)
4 装置档案的说明,通常在/dev下的档案
5 设定档或者是某些档案的格式
6 游戏(games)
7 惯例与协定等,例如Linux档案系统、网络协定、ASCII code等等的說明
8 系統管理員可用的管理指令
9 跟kernel有关的文件

举例

终端输入 man 2 getpid

即可显示 getpid函数的相关信息

GETPID(2)                                  Linux Programmer's Manual                                  GETPID(2)NAMEgetpid, getppid - get process identificationSYNOPSIS#include <sys/types.h>#include <unistd.h>pid_t getpid(void);pid_t getppid(void);DESCRIPTIONgetpid() returns the process ID (PID) of the calling process.  (This is often used by routines that gen‐erate unique temporary filenames.)getppid() returns the process ID of the parent of the calling process.  This will be either  the  ID  ofthe  process  that created this process using fork(), or, if that process has already terminated, the IDof the process to which this process has been reparented (either init(1) or a  "subreaper"  process  de‐fined via the prctl(2) PR_SET_CHILD_SUBREAPER operation).ERRORSThese functions are always successful.CONFORMING TOPOSIX.1-2001, POSIX.1-2008, 4.3BSD, SVr4.NOTESIf the caller's parent is in a different PID namespace (see pid_namespaces(7)), getppid() returns 0.From a kernel perspective, the PID (which is shared by all of the threads in a multithreaded process) issometimes also known as the thread group ID (TGID).  This contrasts with the  kernel  thread  ID  (TID),which  is  unique  for  each  thread.   For  further  details,  see  gettid(2) and the discussion of theCLONE_THREAD flag in clone(2).C library/kernel differencesFrom glibc version 2.3.4 up to and including version 2.24,  the  glibc  wrapper  function  for  getpid()cached PIDs, with the goal of avoiding additional system calls when a process calls getpid() repeatedly.Normally this caching was invisible, but its correct operation relied on support in  the  wrapper  func‐tions  for fork(2), vfork(2), and clone(2): if an application bypassed the glibc wrappers for these sys‐tem calls by using syscall(2), then a call to getpid() in the child would return the wrong value (to  beprecise:  it  would return the PID of the parent process).  In addition, there were cases where getpid()could return the wrong value even when invoking clone(2) via the glibc wrapper function.  (For a discus‐sion  of one such case, see BUGS in clone(2).)  Furthermore, the complexity of the caching code had beenthe source of a few bugs within glibc over the years.Because of the aforementioned problems, since glibc version 2.25, the PID cache  is  removed:  calls  togetpid() always invoke the actual system call, rather than returning a cached value.SEE ALSOclone(2),  fork(2),  gettid(2), kill(2), exec(3), mkstemp(3), tempnam(3), tmpfile(3), tmpnam(3), creden‐tials(7), pid_namespaces(7)COLOPHONThis page is part of release 4.16 of the Linux man-pages project.  A description of the project,  infor‐mation   about   reporting   bugs,   and   the   latest   version   of   this  page,  can  be  found  athttps://www.kernel.org/doc/man-pages/.Linux                                              2017-11-26

Linux笔记--man指令(福利)相关推荐

  1. linux查看进程运行日志文件,【Linux】常用指令、ps查看进程、kill杀进程、启动停止tomcat命令、查看日志、查看端口、find查找文件...

    1.说出 10 个 linux 常用的指令 1) ls 查看目录中的文件 2)cd /home 进入 '/ home' 目录:cd .. 返回上一级目录:cd ../.. 返回上两级目录 3)mkdi ...

  2. 【03】Linux笔记

    Linux 笔记 装机必备 立刻关机 sudo shutdown -t now 设置fish为默认shell chsh -s /usr/bin/fish 安装ssh服务 sudo apt instal ...

  3. OS和Linux笔记

    OS和Linux笔记 操作系统 基本概念 进程管理 进程和线程 协程 同步互斥 死锁 CAS技术 IPC 线程间通信 内存管理 Linux 基础知识 守护进程 系统监测 编译调试 文件管理 零拷贝技术 ...

  4. Linux笔记——软件包管理

    软件包管理,就是对Linux操作系统的软件及安装包进行管理,比如下载.安装.卸载.删除等,等同于Windows控制面板->软件管理. 一.软件包分类 二进制包--已经编译好的,如rpm包 源代码 ...

  5. linux下tree指令的用法

    linux下tree指令的用法 (2010-04-20 23:23:48) 转载 标签: 杂谈 分类: linux学习笔记 首先来看tree的用法 tree 中文解释:tree 功能说明:以树状图列出 ...

  6. linux ps结果解析,Linux笔记-ps -aux的结果解析

    ps 的参数说明 ps 提供了很多的选项参数,常用的有以下几个: l 长格式输出: u 按用户名和启动时间的顺序来显示进程: j 用任务格式来显示进程: f 用树形格式来显示进程: a 显示所有用户的 ...

  7. Linux笔记——常用命令详解及Shell脚步基本用法

    Linux笔记 修改运行级别 临时切换运行级别:用init命令,例如进入级别3 [root@localhost ~]# init 3 永久切换,需要修改配置文件vi /etc/inittab 重启虚拟 ...

  8. Linux部分实用指令

    Linux部分实用指令 对文件.文件夹操作 ls(list) mkdir(make directory) touch cp(copy) mv(move) rm(remove) vim cat head ...

  9. Linux笔记 [全文字数1.6W]

    Linux笔记 文章目录 Linux笔记 第一章 Linux基本介绍 1.1 Linux目录结构 1.1.1 具体的目录结构 1.1.2 总结 1.2 vi和vim编辑器 1.2.1 定义 1.2.2 ...

最新文章

  1. 好看又好用的 GUI,你需要这七个 Python 必备库,
  2. Servlet的Filter的使用
  3. 数据表_业务地址(Business Address)信息
  4. 利用nf_conntrack机制存储路由,省去每包路由查找
  5. 多网卡下如何配置指定IP走某个路由器(适用于外网不通,但是钉钉服务器通的情况)...
  6. infor wms 项目启动_广汽本田增城工厂No.2L WMS项目正式启动
  7. python reduce函数_Python reduce()函数的用法小结
  8. EntityFramework 实体拆分与表拆分
  9. c语言图片base64编码,C语言实现Base64编码
  10. 特斯拉Model S续航里程提高至409英里 刷新纪录
  11. c语言课程设计小时钟,【图片】发几个C语言课程设计源代码(恭喜自己当上技术小吧主)【东华理工大学吧】_百度贴吧...
  12. Delphi窗体显示Echarts图表
  13. 硬盘IDE和AHCI模式的区别
  14. centOS7 清理系统垃圾
  15. 美国三大股指再创新高:纳指开盘上涨0.29%
  16. 我终于开通了微信公众号
  17. 在线阅读-阿里Java开发手册最强版本【泰山版】
  18. Android 获取最近几天的日历日程
  19. 北理工计算机学院沈建斌,沈建冰_北京理工大学计算机学院
  20. Codeforces #308 C. Vanya and Scales

热门文章

  1. CAS 单点登录 5.39 版本 自定义登录页面改造 响应式页面
  2. “大数据+大会员+一体化+个性化”引领线下零售O2O革命
  3. IEEE Verilog 手册 第14章 Specify blocks
  4. ws550 第三方固件_华为 WS550 无线路由器固件升级
  5. linux vim 前端开发,一个前端开发工程师的 Vim 跟 IDE 一样
  6. 人工智能是否存在「大统一理论」?
  7. TensorFlow实现seq2seq
  8. NAT ALG和STUN技术
  9. 【代码笔记】iOS-钢琴小游戏
  10. 三相桥式电路工作在有源逆变