'top' command question

Tony Arnold tony.arnold at manchester.ac.uk
Tue Jul 8 12:52:16 UTC 2008



Karl Larsen wrote:
> NoOp wrote:
>> On 07/07/2008 05:22 PM, Robert Dailey wrote:
>>   
>>> Hi,
>>>
>>> Right now I'm trying to find all running processes in 'top' by command
>>> name. For example, I want to find all processes with a command of
>>> 'iperf', I have an iperf daemon running and I need to find the PID for
>>> it in the list so I can kill it with <k>. How can I navigate the list
>>> of processes in 'top'? Note that I'm using Ubuntu Server 8.
>>>
>>> Thanks.
>>>
>>>     
>> Start top with a delay, so that it slows down the update:
>>
>> top -d10
>>
>> Then use Shift 'R' to swap the top and bottom pages so that you can see
>> what they are. But it's easier to use ps aux:
>>
>> ps aux | grep iperf
>>
>> the first number to the right of the User will be the PID.
>>
>>
>>   
>     For a really long time I have used $ps -A which lists all the 
> kernels activities and when you see the one you want to stop you do that 
> by remembering the number of the item like 6324 and you kill it with 
> $sudo kill 6324.

You should also look at the pgrep and pkill man pages. They make this
easier.

Regards,
Tony.
-- 
Tony Arnold,                        Tel: +44 (0) 161 275 6093
Head of IT Security,                Fax: +44 (0) 870 136 1004
University of Manchester,           Mob: +44 (0) 773 330 0039
Manchester M13 9PL.                 Email: tony.arnold at manchester.ac.uk




More information about the ubuntu-users mailing list