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.

When running a program that goes into an infinite loop in the terminal, how would I bring back the command prompt?

(I'm using Fedora core 5)

share|improve this question

migrated from stackoverflow.com Jan 14 '10 at 12:00

This question came from our site for professional and enthusiast programmers.

    
Fedora 5? As in "five"??? –  balpha Jan 13 '10 at 15:28

7 Answers 7

up vote 5 down vote accepted

You could send a SIGHUP (Ctrl-Z) or SIGTERM (Ctrl-C). The former merely pauses the program, you may resume with fg (or resume as a background process, using bg).

share|improve this answer

You'll have to kill the program using Ctrl + C where C stands for Cancel.

share|improve this answer

Launch the program with & at the end to cause it run in the background. Note that if you exit the terminal, the application might/will stop as well.

root@root:~$ run_app with params &

Using Ctrl+C will kill it if you forgot the &.

share|improve this answer

There is no way to prove that any arbitrary program will ever end without actually running it to the end.

Having said that, it is possible to set up a watchdog via e.g. D-Bus that can kill a program if a response is not received within a given amount of time.

share|improve this answer

Either Ctrl-C as mentioned, or if that should not work, open another terminal, find the process using ps -ef|grep , find the process ID (pid), and use the kill command: kill -9

share|improve this answer

As mentioned, you can simply add a & to the command line. You can also hit CTRL-Z (this puts the process in the Stopped state), and then type bg to get it running in the background again...

share|improve this answer

You can press Ctrl + C.

share|improve this answer

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.