如何查看进程是否在UNIX中被挂起 [英] How to see if a process is suspended in unix

查看:42
本文介绍了如何查看进程是否在UNIX中被挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试恢复所有已暂停的进程,但是我不知道如何检查某个进程是否已暂停.我试过了,但没有表明进程是否已暂停或正在运行.

I'm trying to resume all processes that are suspended ,but i have no idea how to check if a process is suspended. I tried but it dose not indicate if the process is suspended or running.

推荐答案

如果您使用的是Linux,但可移植性更高的解决方案,则可以使用Ipor的方式(/proc/< pid>/status )适用于大多数Unix/Unix之类的操作系统的操作是使用Barmar在注释中已经建议的标准命令:

You might use Ipor's way (/proc/<pid>/status) if you are using Linux but a more portable solution that should work with most Unix/Unix likes OSes would be to use a standard command as Barmar already suggested in a comment:

ps -o s= -p <pid>

这将显示已暂停进程的 T (也由于调试而停止).

This will show T for a suspended process (also if stopped because being debugged).

这篇关于如何查看进程是否在UNIX中被挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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