Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Killing, how 2 kill a process?
edge_lv
post Nov 20 2005, 12:01 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 20-November 05
Member No.: 5,758



help me please to kill some hanged up processes! it`s MPlayer, which I launched several times and I can not exit it any more. right now they are 6 down there...

i know there`s a comand that has to be written in Console, that kills the process. killall, i guess... but there must be some parameters, which i cann`t figure out. job ID for example. how can I figure it out?
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Jim
post Nov 21 2005, 01:39 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



Here is a useful little trick....

ps aux | grep keyword | grep -v grep | awk {'print $2'} | xargs kill

That will list out all the running processes, show only those with that specific keyword in it, remove the "grep keyword" line, make a list of all there IDs (make sure your formating is right, most machines will put the PID in the second column, if its not, then change the $#), then pass that to kill. Its handy when killall isn't finding the right processes.

Here is another tip. Now, you HAVE to be careful with this because you can screw up your system. If anything goes wrong its usually re-boot fixable, but not always, so make sure you are aware of the risk. If you have a processes that is really stuck, one where just kill wont fix it you can run kill -9 ######

The dash nine (affectionately know as the shotgun) will just kill the processes regardless of what it is waiting on. Usually when a process is hanging its because its waiting on some piece of memory, or of your system. If you shotgun a program, it may very well leave parts of itself in your memory, which wont free until reboot. Or, if that processes has crabbed onto something like sound, it may not release it correctly. So, use it sparingly.


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post

Posts in this topic
- edge_lv   Killing   Nov 20 2005, 12:01 PM
- - DS2K3   killall mplayer or, use ps -Al to find the proces...   Nov 20 2005, 02:15 PM
- - edge_lv   TNX! i made it. finally I wrote "kill...   Nov 21 2005, 03:24 AM
- - Jim   Here is a useful little trick.... ps aux | ...   Nov 21 2005, 01:39 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th December 2017 - 10:16 PM