Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm fairly new to OS X. I am testing a PHP application that runs continuously in a loop.

When I run this application from the terminal, the machine name disappears and the application proceeds to echo out all of the statements as it is supposed to do.

However, while in this state (no 'machine name', no obvious way to enter commands) I cannot stop the application from running.

How can I stop the application from running in this state?

share|improve this question

migrated from serverfault.com May 1 '12 at 21:02

This question came from our site for professional system and network administrators.

    
Send the command to a screen using the screen command? –  SpacemanSpiff May 1 '12 at 20:37
add comment

3 Answers

up vote 12 down vote accepted

Stopping the program altogether can be achieved by pressing Ctrl-C.

share|improve this answer
    
Thanks. I have Googled that more then once. –  John R May 1 '12 at 21:00
    
Also note that Command-Period will send a Control-C. –  Chris Page May 3 '12 at 6:26
add comment

Ctrl-C is the appropriate keys to terminate an application running in the terminal foreground. It sends a SIGTERM to the task running in the foreground. When an application receives a SIGTERM it should clean up after itself and then cleanly quit.

Ctrl-Z will send a SIGTSTP. This signal is particularly useful because it doesn't end the execution of the program; it essentially pauses it. You can use this signal along with the fg and bg commands to move running programs to the foreground or background, executing multiple programs at once, or just to relieve strain when the computer is doing too many things at once and you don't want to kill any running applications.

Ctrl-D does not actually send a signal, but it is used to indicate end of transmission or file. Programs that read standard input may interpret this as a close condition. (For example, it will cause shells on UNIX-like systems to exit.)

share|improve this answer
add comment

And if Ctrl-C doesn't do it for you, Ctrl-D might do the trick.

So will using the very friendly "Activity Monitor" which is located at /Applications/Utilites/Activity Monitor.app

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.