This is the output: [USER@SERVER ~] ping localhostPING localhost (127.0.0.1) 56(84) bytes of data.64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.024 ms64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.030 ms64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.026 ms64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.026 ms^Z[1]+  Stopped                 ping localhost[USER@SERVER ~] jobs[1]+  Stopped                 ping localhost[USER@SERVER ~] bg %1[1]+ ping localhost &64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.034 ms[USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.030 ms64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.032 ms[USER@SERVER ~] ^C[USER@SERVER ~] ^C[USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.031 ms^C[USER@SERVER ~] 64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.031 ms64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.028 mski64 bytes from localhost (127.0.0.1): icmp_seq=12 ttl=64 time=0.030 msll %64 bytes from localhost (127.0.0.1): icmp_seq=13 ttl=64 time=0.031 ms1[1]+  Terminated              ping localhost[USER@SERVER ~] of:1) I start to ping localhost2) CTRL+Z3) bg %14) CTRL+C doesn't work. 5) I have to type kill %1 to kill it..What is the real-life use of the bg command? Where is it used in the real world?
What is the real-world use of the bg command?
job control
You use bg normally to run programs in the background, which has no console interaction, like most program with a graphical user interface. Example: You wanted to run xterm & but forgot the & to run the terminal emulator in the background. So you stop the (blocking) foreground xterm process with Ctrl-Z and continue it in the background with bg.If you want to send Ctrl-C to a background process, put it first with fg in the foreground again (or use kill -2 %1).