bg
Linux Commands - Managing System and Program Info

bg

 

This command will allow you to place a command in the background and continue function.

In the example you see a series of commands in reference to the command top. First you see top being placed in the background by using the command and &. This lists the job number 1 and the PID 17422. You may also place a command in the background by stopping a program with Ctrl+z and the command bg; which is also shown in the example. The program is brought to the foreground with the fg command and is then seen in the output on the screen as shown.



top &

[1] 17422

bg

[1]+ top &

fg

top


top - 12:59:30 up 10:28, 2 users, load average: 0.14, 0.11, 0.17

Tasks: 78 total, 2 running, 76 sleeping, 0 stopped, 0 zombie

Cpu(s): 15.1% us, 1.2% sy, 0.0% ni, 83.6% id, 0.0% wa, 0.1% hi, 0.0% si

Mem: 256812k total, 206284k used, 50528k free, 2236k buffers

Swap: 514040k total, 114208k used, 399832k free, 66296k cached


PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

9273 mike 16 0 38556 9532 7156 R 9.9 3.7 0:17.48 gnome-terminal

6009 root 15 0 84484 35m 4876 S 4.4 14.2 118:55.81 Xorg

9110 mike 15 0 185m 47m 23m S 0.9 18.8 5:23.15 soffice.bin

7703 mike 15 0 12908 6576 5744 S 0.4 2.6 0:13.55 metacity

7722 mike 15 0 18016 8272 7020 S 0.2 3.2 0:12.53 wnck-applet