Create account Login Webmail Contact Us



 
Knowledgebase
How to kill a process in BSD.
Posted by Mike C. on 11 September 2009 11:58 PM
To kill a process you must first know to PID number. To find this out you will type the following:

# ps aux
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 23 0.0 0.0 212 68 ?? Is 18Mar06 0:00.00 adjkerntz -i
root 7 0.0 0.0 0 0 ?? DL 18Mar06 0:26.34 (vnlru)
root 6 0.0 0.0 0 0 ?? DL 18Mar06 73:36.77 (syncer)
root 5 0.0 0.0 0 0 ?? DL 18Mar06 0:26.60 (bufdaemon)
root 4 0.0 0.0 0 0 ?? DL 18Mar06 0:00.00 (vmdaemon)
root 3 0.0 0.0 0 0 ?? DL 18Mar06 0:12.62 (pagedaemon)
root 2 0.0 0.0 0 0 ?? DL 18Mar06 0:00.00 (taskqueue)
root 1 0.0 0.0 556 212 ?? SLs 18Mar06 0:40.47 /sbin/init --
root 0 0.0 0.0 0 0 ?? DLs 18Mar06 0:00.00 (swapper)
user1 42293 0.0 0.0 0 0 ?? Z Sun12AM 0:00.00 (psybnc)
user1 42294 0.0 0.0 0 0 ?? Z Sun12AM 0:00.00 (psybnc)

# kill -s 42293

This shows how to first find the PID number and then how to kill is. If kill -s doesn't work you can always try:

# kill -9 42293

If you want to kill all processes named "psybnc" on the system you can type:

# killall psybnc

BE CAREFUL with the killall function because you might mistype and kill something you don't want to kill.
(480 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: