to list processes that are running in the background, one can type:
ps -ef
or ps -aux
but how to list processes that are suspended, let's say I had some process in the foreground and just suspended (either with bg <jobid>
or Ctrl+z
)
how to I get to know what are the processes in that status (suspended)?
thanks
Best Answer
The output of
ps
includes the status:The
STAT
column is the state of the process. This can be one of (fromman ps
):So, you are looking for processes whose state is shown as
T
. To see only those processes, you can parse theps
output for them:Sometimes, additional characters can be added to the state field (depending on the options you use), so this might be a safer approach: