# greping for a process that is in nanslp statr



## bv_arvind (Jul 16, 2012)

Hi,

I have process in nanslp state, I saw it in top(1) o/p. However grepping top for the process name does not return anything. Doesn't sleeping process show up in *top | grep <proc-name>*?
Thanks


----------



## SirDice (Jul 17, 2012)

Why don't you use pgrep(1)?


----------



## fluca1978 (Jul 17, 2012)

It works for me regular grep(1) against top(1):


```
> top | grep cron                       
 1302 root        1  44    0  3380K  1024K nanslp   0:00  0.00% cron                       
 1419 root        1  44    0  3380K  1356K nanslp   0:00  0.00% cron
```

But, as already suggested, if your aim is to grepping out process, pgrep(1) should do a better job.


----------



## bv_arvind (Jul 17, 2012)

Thanks, pgrep seemed to do the trick for me.


----------

