LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2011, 05:52 AM   #1
makhlouf
LQ Newbie
 
Registered: Feb 2011
Location: Algeria
Posts: 1

Rep: Reputation: 0
stop an executable file


i run this command on file : chmod u+x recon (recon is the name of the file). then i run the file in question (. recon). i just want to stop it; how to do this ?
 
Old 02-23-2011, 05:57 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Code:
ps aux | grep recon
Run that, and you will get the PID of the process. Just do a "kill PID" and that's it. Good luck.

---------- Post added 02-23-11 at 11:57 AM ----------

Or if it doesn't run to background, CONTROL and C
 
Old 02-23-2011, 06:03 AM   #3
tonyhawz
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
for example if you want to kill firefox
Code:
$ ps -ef | grep firefox 
username    1033  1000  0 08:59 pts/1    00:00:00 grep firefox
username   31879 31875 28 08:34 ?        00:07:21 /usr/lib/firefox-3.6.13/firefox-bin
you get the pid number which is 31879
Code:
$ kill -9 31879
hope it helps
 
Old 02-23-2011, 10:21 PM   #4
kernelzack
LQ Newbie
 
Registered: Jun 2009
Distribution: Centos
Posts: 25

Rep: Reputation: 15
Kind of sloppy way to do this but it has never failed me

Say you wanted to kill firefox

kill `ps aux | grep firefox `

This will give you output saying "pid does not exist" etc etc, it runs the kill command on all output from previous command so ignore that. It will however kill the pid your targeting.
 
Old 02-24-2011, 12:26 AM   #5
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 872

Rep: Reputation: 112Reputation: 112
If it run in the terminal where you can't type you can try

<ctrl> + c
 
Old 02-24-2011, 01:21 AM   #6
ntu929
Member
 
Registered: Jun 2010
Location: India
Distribution: Ubuntu
Posts: 128

Rep: Reputation: 4
u can also try ctrl+z in some situations
 
Old 02-24-2011, 01:29 AM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
killall -9 recon perhaps?
 
Old 02-24-2011, 12:41 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by kernelzack View Post
Kind of sloppy way to do this but it has never failed me

Say you wanted to kill firefox

kill `ps aux | grep firefox `

This will give you output saying "pid does not exist" etc etc, it runs the kill command on all output from previous command so ignore that. It will however kill the pid your targeting.
And that's where you pipe it into awk.....

One more way to do it.... You can just use pkill.

Code:
pkill firefox
 
1 members found this post helpful.
Old 02-24-2011, 12:49 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Indeed using 'pkill' (also see 'pgrep' where people think 'ps|grep') is often faster and more efficient. Doesn't work in all cases though.
 
Old 02-24-2011, 01:14 PM   #10
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by unSpawn View Post
Indeed using 'pkill' (also see 'pgrep' where people think 'ps|grep') is often faster and more efficient. Doesn't work in all cases though.
That's why I said it's just one more way of doing it. There are many different ways....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop files moved to Linux from Windows via USB being marked "executable"? rnturn Linux - General 4 09-28-2010 08:32 PM
[SOLVED] How would I convert an arbitrary binary file into a Linux executable file? ootawata Programming 8 02-22-2010 12:21 AM
Reading an executable file adam405 Linux - Newbie 1 02-02-2009 05:23 AM
Howto convert bin file to a executable DOS file lilzz Linux - Newbie 5 08-04-2006 01:03 AM
Linux Executable File Help (created from a .c file) MattG1981 Linux - Newbie 7 06-06-2004 05:54 PM


All times are GMT -5. The time now is 02:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration