how can I find out the process ids with a process name

Michael Bentley michael at jedimindworks.com
Sun Sep 2 16:32:54 EDT 2007


>
> cd /proc
> for i in ls [0-9]*/status
> do
>      echo $i `grep '^Name' $i | cut -f2` | sed 's/\/status//g'
> done
>


Um...

cd /proc
for i in `ls [0-9]*/status`
do
     echo $i `grep '^Name' $i | cut -f2` | sed 's/\/status//g'
done


---
Let the wookie win.






More information about the Python-list mailing list