Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Basic terminal question.

Basic terminal question.
Thread Tools
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Sep 26, 2003, 02:23 AM
 
I took a sudo ping -f for testing purposes on my home network. Anyway to quit the process I accidentally pushed ctrl+z (i think) instead of ctrl+c, so the process suspended instead of quitting. Can any one please tell me how I can continue the process? I tried to kill it, but it didn't respond to sudo kill <process>. I am on OS X 10.2.6.
Thanks.

Sniffer gone old-school sig
     
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status: Offline
Reply With Quote
Sep 26, 2003, 02:27 AM
 
have you tried "sudo kill -9 <process id>" ?
     
Dedicated MacNNer
Join Date: May 2003
Location: Santa Barbara
Status: Offline
Reply With Quote
Sep 26, 2003, 02:57 AM
 
fg
     
sniffer  (op)
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Sep 26, 2003, 03:03 AM
 
Hey, that worked nicely. Thanks.
I got the process killed finally.

But BTW how do you make use the suspend (ctrl+z) function and make the processes continue afterworths? Thanks.

Sniffer gone old-school sig
     
sniffer  (op)
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Sep 26, 2003, 03:50 AM
 
Originally posted by bracken:
fg
Thanks, thought it wasn't easy figure out what you meant.
From man fg:
Code:
run-fg-editor (M-^Z) Saves the current input line and looks for a stopped job with a name equal to the last compo- nent of the file name part of the EDITOR or VISUAL environment variables, or, if neither is set, `ed' or `vi'. If such a job is found, it is restarted as if `fg %job' had been typed. This is used to toggle back and forth between an editor and the shell easily. Some people bind this command to `^Z' so they can do this even more easily.
But I think I got a picture.

Sniffer gone old-school sig
     
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Sep 27, 2003, 04:47 AM
 
Originally posted by sniffer:
Thanks, thought it wasn't easy figure out what you meant.
I just type "jobs" and then type % and the number of the suspended/backgrounded job I want to bring to the foreground.

Code:
[Alan-Orths-Computer:~] aorth% jobs [1] Suspended top [2] - Suspended top [3] + Suspended top -u [Alan-Orths-Computer:~] aorth% %1
Then you can quit them normally.
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
sniffer  (op)
Professional Poster
Join Date: Nov 2000
Location: Norway (I eat whales)
Status: Offline
Reply With Quote
Sep 27, 2003, 03:17 PM
 
Originally posted by [APi]TheMan:
I just type "jobs" and then type % and the number of the suspended/backgrounded job I want to bring to the foreground.

Code:
[Alan-Orths-Computer:~] aorth% jobs [1] Suspended top [2] - Suspended top [3] + Suspended top -u [Alan-Orths-Computer:~] aorth% %1
Then you can quit them normally.
Great tip! Big thanks! And easier to use than fg too if you have more than one application on suspend IMO.

Sniffer gone old-school sig
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Sep 28, 2003, 08:11 AM
 
Originally posted by sniffer:
Great tip! Big thanks! And easier to use than fg too if you have more than one application on suspend IMO.
You can also do things like... if you suspended a process with Ctrl-Z but want it to continue in the background and not have to restart it with fg or kill %1 (or whatever)... just type

bg %1

and the job you suspended will be backgrounded. This is also handy if you started a process and it takes longer than you expected to complete, or if you just forgot to do:

somecommand &

You can suspend it (Ctrl-Z) then backgound it (bg %1).
-DU-...etc...
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:45 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2