Results 1 to 10 of 10
i want to find a running process call "iHackedYou.sh" and kill it. how do i do that? i tried:
find iHackedYou.sh -exec kill '{}' \;
but does not work...
- 10-21-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 34
how to find a process by name and kill it
i want to find a running process call "iHackedYou.sh" and kill it. how do i do that? i tried:
find iHackedYou.sh -exec kill '{}' \;
but does not work
- 10-21-2007 #2
Enter this at the command line
and all will be revealed.Code:man killall
- 10-21-2007 #3
Well, there are actually several ways to do this. The most straightforward would be using the "killall" command. The "kill" command takes a process ID, the "killall" command takes a process name.
A second way would be to use either the "top" command or "ps aux" to see all running processes, find the PID that you want to end, and use "kill" to do so. This way, if you have two instances of Firefox running, you can end only the one you want to end.
And the third way, and most complicated, would be to look at the numbered directories in /proc/. Each of these is a PID. Inside each of these directories is a "cmdline" file that tells the command run to get that PID. You could search these for the command you want, and kill the appropriate PIDs.
It's a big world out there!DISTRO=Arch
Registered Linux User #388732
- 10-21-2007 #4This will show any process that has string in its process name.Code:
pgrep string | xargs ps
This will kill all processes that contain string anywhere in their process name. A little dangerous, cause you might kill processes you don't want to.Code:pkill string
- 10-21-2007 #5
Often Firefox will freeze when viewing Youtube videos. I have to xkill Firefox, but it will still be running, hindering me from restarting it. I find htop the best solution. Just open it, find the process and kill it as you would in regular top. The thing I like about htop is that you can easily move up and down through the processes stopping at the one you want and killing it with two key presses.
- 10-23-2007 #6Just Joined!
- Join Date
- Oct 2007
- Posts
- 1
Not terribly elegant, I usually just use
Code:kill -9 `pgrep string`
- 10-23-2007 #7
ps aux : will also show you your processes and you can also you killall -9 pid#
- 10-23-2007 #8Linux User
- Join Date
- Aug 2006
- Posts
- 458
- 10-24-2007 #9
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 10-24-2007 #10
I recommend pkill. Check out the -f option for more precision.
man 1 pkill


Reply With Quote
