Thursday, May 18, 2006

Moving a foreground process to the background in UNIX

Below is an example of moving a process already running in the foreground to the background:

1) To start we have a script running in the foreground

/home/javaoneman>runTest.sh

2) Press CTRL-Z to place the process in a suspended state.

The following should appear on the console:

^Z

[1]+ Stopped runTest.sh

3) Move the suspended process into the background using the bg command

/home/javaoneman>bg

The following confirmation should appear on the console:

[1]+ runTest.sh &

Thanks to Dalhousie University Computer Science Department for providing this useful information on UNIX process control

Labels: