Download your favorite Linux distribution at LQ ISO.
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, 01: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, 01:43 PM   #2
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
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, 05: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, 05: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
running jobs on the background feetyouwell Linux - Software 5 09-07-2019 03:13 PM
Nohup and Background Jobs Onyx2316 Linux - Newbie 3 02-28-2012 12:10 AM
Background jobs paddyjoy Linux - Newbie 2 07-19-2005 01:46 AM
background jobs seize630 Linux - General 6 10-14-2003 03:16 PM
URGENT: how can you log out without killing jobs cestor Linux - General 2 01-23-2002 01:21 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:02 PM.

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