Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First, I write a simple PHP script

    echo 'hey'.PHP_EOL;

Then I run it like:

php test.php &

Obviously goes into background, but keeps running and prints hey repeatedly.

Now run it like:

php test.php

and hit Ctrl+Z while it is running. It goes into background but stops running.

Why stop running? How to keep it running while it goes into background? Think of time when you run something and in the middle of it, you realize you should do something real quick.

share|improve this question
up vote 4 down vote accepted

Ctrl-z sends SIGTSTP to the process, suspending it. To background it properly you need to run bg afterwards.

share|improve this answer
Thanks! Very sad it did not come to my mind. Seems like an obvious thing :) – thelastblack Sep 4 '14 at 11:27

Your Answer


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.