简体   繁体   English

如何获取自Linux机器上次引导以来已创建的进程数

[英]How do I get the no of processes that have been created since the last boot on a Linux machine

How do I get the no of processes that have been created since the last boot on a Linux machine. 如何获得自Linux机器上次启动以来已创建的进程数。

I want to use it in a C++ program so I prefer just knowing which proc file has it 我想在C ++程序中使用它,所以我更喜欢只知道哪个proc文件具有它

If you want to know the number of forks there is /proc/stat : 如果您想知道forks的数量,则有/proc/stat

 processes XXXX Number of forks since boot. 

自上次启动以来的叉数:

vmstat -f

Looking at processes inside /proc/stat will show you the number of processes created which may include the processes created using fork() as well as clone() . 查看/proc/stat的进程将向您显示创建的进程数,其中可能包括使用fork()clone()创建的进程。 To get the number of procceses forked since bootup you will have to run 要获取自启动以来分叉的过程数,您必须运行

vmstat -f

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何确定linux机器目录中最新创建的文件? - How do I determine the newest created file in a directory on a linux machine? 如何在不丢失 state 进程的情况下 hibernate 虚拟机并在新机器上启动它? - How do I hibernate a VM and boot it on a new machine without losing state of processes? 如何在XXX毫秒内阻止Linux机器上的所有其他进程? - How do I block all other processes on a Linux machine for XXX milliseconds? 我如何获得最近一个小时左右在Linux机器上运行的进程的列表? - How do I get a list of process that have run on my linux box during the last hour or so? 从子进程访问字符串数组,这些子进程是在C linux中的分叉之前创建的 - Accessing arrays of strings from child processes that have been created before the fork in C linux 如何在Linux机器上获取我的CUDA规范? - How do I get my CUDA specs on a Linux machine? 如何显示自从上次在Linux中重新启动系统以来,最多运行了什么程序 - how show what program has been run the most times since the system was last rebooted in linux 如何从Java应用程序中准确获取Linux中正在运行的进程的列表? - How do I get an accurate list of running processes in Linux from a Java application? 如何在montavista linux上为守护进程启用核心转储? - How do I enable core dumps for daemon processes on montavista linux? 我如何找出这些文件或进程的作用(Linux) - How can I find out what these files or processes do (linux)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM