Run Scripts on Background (Linux)

Run a script in the background by appending an & to the end of a command, for instance:

$> ./ &

If you run a script and forgot to append the &. You can hit Ctrl+Z to pause the process that is currently running, and give you a shell. Then type bg to send that process into the background. To see how its doing, you can use the jobs command. To send it back into the foreground you can use the fg command.

So for example you might do something like this:

$> ./
hits Ctrl+Z
[1]+ Stopped ./
$> bg
[1]+ ./ &
$> jobs
[1]+ Running ./ &
$> jobs
[1]+ Done ./



PISIKA Copyright © 2009