WEBVTT

00:00.740 --> 00:05.180
Sometimes we will want to stop a process without terminating it.

00:05.300 --> 00:10.910
This is often done to lower the foreground process to move to the background.

00:11.000 --> 00:15.080
So stop a foreground process and place it in the background.

00:15.110 --> 00:17.030
Press control Z.

00:17.450 --> 00:19.040
Actually, let me write that down here.

00:19.040 --> 00:19.970
Control.

00:21.800 --> 00:22.190
Here.

00:25.640 --> 00:27.350
Control.

00:32.750 --> 00:33.920
Plus Z.

00:35.540 --> 00:43.610
Here, so you will want to press Ctrl Z to stop a foreground process and place it in the background.

00:43.610 --> 00:44.420
So let's try it.

00:44.420 --> 00:49.100
And at the command prompt here we will type the X logo.

00:49.190 --> 00:54.860
And here, as you can see, our X logo is opened right here now.

00:55.370 --> 00:59.360
And actually let's make it on the top so we will see what happens.

00:59.630 --> 01:02.000
Right now, always on top.

01:02.000 --> 01:04.160
Let's make it bigger here.

01:04.880 --> 01:08.150
So now let's press the Ctrl Z.

01:09.540 --> 01:18.370
And as you can see here, the we can interact with the bash, but also the logo X logo program is not

01:18.390 --> 01:19.170
terminated.

01:19.290 --> 01:26.880
So after stopping X logo, we can verify that the program has stopped by attempting to resize.

01:27.420 --> 01:28.800
As you can you see here.

01:28.980 --> 01:29.700
Yeah.

01:30.270 --> 01:33.840
It's not behaving as like the previous example, right.

01:33.930 --> 01:36.420
So the program.

01:37.360 --> 01:41.860
Stopped, um, by at when we attempt to resize the logo window.

01:41.860 --> 01:44.530
So we will see that it appears quite dead.

01:44.560 --> 01:51.100
So we can either continue the program execution in the foreground using the FG command.

01:53.060 --> 01:58.850
Or resume the program's execution in the background with the BG command here actually now we will pray

01:58.880 --> 02:01.010
and we will pray another control here.

02:01.010 --> 02:03.890
It's almost suspended here, as you can see here.

02:03.890 --> 02:07.700
It will not print our appropriate X logo right here.

02:07.700 --> 02:11.060
And let's now use the BG here.

02:11.060 --> 02:13.880
And as you can see here, it is also.

02:15.980 --> 02:25.070
Provide from our background here, but now we can also interact when we write here by BG instead of

02:25.310 --> 02:28.280
FG, we can also interact with the Terminal Bash script.

02:28.280 --> 02:29.450
So that's it.

02:29.600 --> 02:36.470
So with the FG command, the job spec is optional if there is only one job.

02:36.470 --> 02:37.460
So moving.

02:37.580 --> 02:46.440
So since we don't have any background job at that time, we didn't need to mention it, but if you do

02:46.460 --> 02:49.370
would want to mention it, you will write background.

02:49.370 --> 02:52.490
Firstly, you will write jobs as we did in previous and here.

02:52.490 --> 02:52.730
Now.

02:52.730 --> 03:01.280
After that you will write BG and your job and as you can see here, job already in background.

03:02.080 --> 03:02.590
So.

03:03.760 --> 03:08.650
Moving a process from the foreground to background is handy if we launch a graphical program from the

03:08.650 --> 03:16.540
command line, but forget to place it in the background by appending the trailing and operator.

03:16.540 --> 03:20.890
So why would we want to launch a graphical program from the command line?

03:20.890 --> 03:22.900
So there are two reasons for that.

03:23.140 --> 03:30.430
The program you want to run might not be listed on the window manager menus such as X logon.

03:31.370 --> 03:32.000
Here.

03:33.410 --> 03:34.670
We don't have x logo, right?

03:35.090 --> 03:35.840
X logo.

03:36.720 --> 03:41.310
We just only have run X logo here, which is this is just a comment that runs like X logo.

03:42.210 --> 03:44.130
But we don't have any additional nexus.

03:44.170 --> 03:45.030
Actually, let me.

03:46.260 --> 03:48.750
Close this previous X logo here.

03:50.030 --> 03:50.450
Here.

03:51.360 --> 03:54.180
We don't have X logo in our program.

03:54.180 --> 04:00.780
So biological program from the command line, you might be able to see error messages that would otherwise

04:00.810 --> 04:04.040
be invisible if the program were launched graphically.

04:04.050 --> 04:09.600
So sometimes a program will fail to start up when launched from a graphical menu by launching it from

04:09.600 --> 04:10.440
the command line.

04:10.440 --> 04:14.050
Instead, you may see an error message that will reveal the problem.

04:14.070 --> 04:18.930
Also, some graphical programs have interesting and useful command line options.
