通过PID获取进程名称 [英] Get process name by PID

查看:159
本文介绍了通过PID获取进程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该很简单,但是我只是没有看到它.

This should be simple, but I'm just not seeing it.

如果我有一个进程ID,如何使用它来获取有关该进程的信息,例如进程名称.

If I have a process ID, how can I use that to grab info about the process such as the process name.

推荐答案

在Linux下,您可以读取proc文件系统.文件/proc/<pid>/cmdline包含命令行.

Under Linux, you can read proc filesystem. File /proc/<pid>/cmdline contains the commandline.

这篇关于通过PID获取进程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆