Switch UNIX & Linux Job to Run in Background or Foreground

In UNIX or Linux operating system, you have the ability to switch any jobs to run in background or foreground.

Background to Foreground Job

1. Below program is running on background.

./R3trans -d &

2. Press Ctrl + z to suspend the program and you will get below notification.

[1] 19054

3. Enter command fg with the following number 1.

fg 1

4. The program will now running on foreground.

./R3trans -d 
This is ./R3trans version 6.23 
(release 720 - 17.09.12 - 20:12:05 ). 
unicode enabled version 
./R3trans finished (0000).

Foreground to Background Job

1. Below program is running on foreground.

./R3trans -d

2. Press Ctrl + z to suspend the program and you will get below notification.

[1] 1876

3. Enter command bg with the following number 1.

bg 1

4. The program will now running on background.

./R3trans -d &; 
This is ./R3trans version 6.23 
(release 720 - 17.09.12 - 20:12:05 ). 
unicode enabled version 
./R3trans finished (0000).

You May Also Like

Leave a Reply?