Background processes running on ubantu

J dreadpiratejeff at gmail.com
Mon Jan 30 19:48:28 UTC 2012


On Mon, Jan 30, 2012 at 13:45, Shashank Ghoti <shashank.ghoti at gmail.com> wrote:
> Hi All,
>
> I have 5 processes running in the background. What is the command to  see
> only running background processes (in my case 5 processes)? i have tried
> through ps.
> Can anybody help me to know exact command for that?

Assuming you ran them all in the same shell:

jobs

example:


bladernr at klaatu:~/$ for x in `seq 1 5`; do
> sleep 60 &
> done
[1] 12685
[2] 12686
[3] 12687
[4] 12688
[5] 12689
bladernr at klaatu:~/$ jobs
[1]   Running                 sleep 60 &
[2]   Running                 sleep 60 &
[3]   Running                 sleep 60 &
[4]-  Running                 sleep 60 &
[5]+  Running                 sleep 60 &

AFAIK, it's not possible to background your jobs in one shell and list
them in a different shell, since each shell is it's own shell
environment...




More information about the ubuntu-users mailing list