1.释义

从运行的进程中以名称查找出进程号PID/PPID横向大到小展示

2.系统帮助

PIDOF(8) Linux System Administrator's Manual PIDOF(8)

NAME

pidof -- find the process ID of a running program.

SYNOPSIS

SYNOPSIS

pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..]

DESCRIPTION

Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems used in run-level change scripts, especially when the system

has a System-V like rc structure. In that case these scripts are located in /etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead.

OPTIONS

-s Single shot - this instructs the program to only return one pid.

-c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes

they do not own.

-n Avoid stat(2) system function call on all binaries which are located on network based file systems like NFS. Instead of using this option the the variable PIDOF_NETFS may be set and

exported.

-x Scripts too - this causes the program to also return process id's of shells running the named scripts.

-o omitpid

Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof program, in other words the calling shell or shell script.

-m When used with -o, will also omit any processes that have the same argv[0] and argv[1] as any explicitly omitted process ids. This can be used to avoid multiple shell scripts concurrently

calling pidof returning each other's pids.

EXIT STATUS

0 At least one program was found with the requested name.

1 No program was found with the requested name.

NOTES

pidof is actually the same program as killall5; the program behaves according to the name under which it is called.

When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that it returns pids of running programs that happen to have the

same name as the program you're after but are actually other programs. Note that that the executable name of running processes is calculated with readlink(2), so symbolic links to executables will

also match.

SEE ALSO

shutdown(8), init(8), halt(8), reboot(8), killall5(8)

AUTHOR

Miquel van Smoorenburg, miquels@cistron.nl

3.示例

3.1.以名称查进程号

[root@itbkz ~]#pidof httpd

6557 6556 6555 6554 6553 6552

linux查看进程ppid,pidof命令从运行的进程中以名称查找出进程号PID/PPID横向大到小展示...相关推荐

  1. linux 查看服务器性能常用命令

    2019独角兽企业重金招聘Python工程师标准>>> linux 查看服务器性能常用命令 一.top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况, ...

  2. Linux 查看进程之PS命令

    要对进程进行检测和控制,首先必须要了解当前进程的情况,也就是需要查看当前进程运行状态.Linux 系统中 我们可以使用 ps 命令查看进程. ps 命令介绍       ps(process stat ...

  3. linux查看日志的几种命令,Linux查看日志三种命令(转载)

    第一种:查看实时变化的日志(比较吃内存) 最常用的: tail -f filename (默认最后10行,相当于增加参数 -n 10) Ctrl+c 是退出tail命令 其他情况: tail -n 2 ...

  4. linux查看软件包信息,Linux查看系统信息的一些命令及查看已安装软件包的命令...

    Linux查看系统信息的一些命令及查看已安装软件包的命令 系统 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat ...

  5. linux view查看日志命令,linux查看日志文件内容命令tail、cat、tac、head、echo、vi

    linux查看日志文件内容命令tail.cat.tac.head.echo tail -f test.log 你会看到屏幕不断有内容被打印出来. 这时候中断第一个进程Ctrl-C, --------- ...

  6. java查看日志命令_[Java教程]【Linux】linux查看日志文件内容命令tail、cat、tac、head、echo...

    [Java教程][Linux]linux查看日志文件内容命令tail.cat.tac.head.echo 0 2017-11-14 12:00:29 linux查看日志文件内容命令tail.cat.t ...

  7. linux view查看日志命令,【Linux】linux查看日志文件内容命令tail、cat、tac、head、echo...

    linux查看日志文件内容命令tail.cat.tac.head.echo tail -f test.log 你会看到屏幕不断有内容被打印出来. 这时候中断第一个进程Ctrl-C, --------- ...

  8. linux查看日志文件内容命令tail、cat、tac、head、echo、vi

    linux查看日志文件内容命令tail.cat.tac.head.echo tail -f test.log 你会看到屏幕不断有内容被打印出来. 这时候中断第一个进程Ctrl-C, --------- ...

  9. linux查cpu命令4可以选择哪些运动,Linux 查看cpu 信息的命令及简单实例

    Linux 查看cpu 信息的命令及简单实例 有的时候领导会问你某个服务器是多少核的,多少线程的,是不是会懵了,下面教你怎么看cpuinfo 1.查看cpu个数: # cat /proc/cpuinf ...

最新文章

  1. 周怎么换算成月_您每天需要多少能量,怎么知道自己摄入多少能量
  2. 虚幻引擎4:打造街机经典游戏学习教程 Unreal Engine 4: Create an Arcade Classic
  3. 超神线段树 山海经
  4. Windows phone 应用开发[3]-UI 设计
  5. jackson反序列化时忽略不需要的字段
  6. 【arthas】Arthas 查看 Mbean 的信息
  7. shell脚本循环嵌套
  8. 遗传算法(Python)
  9. 求三维空间中的三角形外接圆圆心坐标的算法
  10. 邹博机器学习代码分析(1)-线性回归
  11. 聚类分析在SPSS上的实现与结果分析——基于SPSS实验报告
  12. windows 编程入门资料
  13. Python 练习实例21 猴子吃桃问题
  14. 微型计算机不是ecu,ECU升级是什么意思?
  15. jzoj5442. 【NOIP2017提高A组冲刺11.1】荒诞
  16. 借助计算机音乐,计算机音乐制作在高校作曲教学中的应用
  17. java GUI mysql实现的薪资工资管理系统项目源码附带视频指导教程
  18. 解析v-if和v-show的区别和使用场景
  19. 基于DEM的降雨淹没算法
  20. Kaldi单步完美运行AIShell v1 S5之三:三音tri1,tri2,tri3,tri4,tri5

热门文章

  1. spring+ibatis配置
  2. 我为什么“放弃”从事八年的嵌入式领域
  3. 关系与普通表的术语比较
  4. 增加表单的文字段的html的代码是,表单及表单新增元素(示例代码)
  5. Python 面向对象之双下方法,内置函数
  6. mysql dbo_mysql-双重分组
  7. 【深度学习】Cifar-10-探究不同的改进策略对分类准确率提高
  8. Day13-日历模块
  9. 如何用余弦定理来进行文本相似度的度量
  10. pytorch神经网络因素预测_实战:使用PyTorch构建神经网络进行房价预测