View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-08-2003, 02:22 PM   #1
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
killing background jobs?

hey, just for future reference i was curoius to know if you set a background job like

grip &

and then it starts misbehaving, how do you go about killing it in CLI?
Old 08-08-2003, 02:43 PM   #2
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 50
1) find its pid with ps, then issue a kill
2) bring it into the forground then kill it
3) run top, and kill it
4) the other 50,000 ways that i cant be bothered to type
Old 08-09-2003, 06:16 AM   #3
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30

every job that you run in backgound has a specific number: from 1 on. So if you run:
gimp &
mozilla &
mc &

and then use:

you will see, that gimp is %1, mc is %3 ... so, it's kill %1 and there goes gimp.
Old 08-09-2003, 06:22 AM   #4
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Or if you want to see what the program is complaining about you can bring it to the foreground again:

fg %1

then you can simply Ctrl+C to break out of it.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nohup and Background Jobs Onyx2316 Linux - Newbie 3 02-28-2012 01:10 AM
running jobs on the background feetyouwell Linux - Software 3 08-02-2005 11:36 AM
Background jobs paddyjoy Linux - Newbie 2 07-19-2005 02:46 AM
background jobs seize630 Linux - General 6 10-14-2003 04:16 PM
URGENT: how can you log out without killing jobs cestor Linux - General 2 01-23-2002 02:21 PM

All times are GMT -5. The time now is 12:15 AM.

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