1 00:00:00,740 --> 00:00:05,180 Sometimes we will want to stop a process without terminating it. 2 00:00:05,300 --> 00:00:10,910 This is often done to lower the foreground process to move to the background. 3 00:00:11,000 --> 00:00:15,080 So stop a foreground process and place it in the background. 4 00:00:15,110 --> 00:00:17,030 Press control Z. 5 00:00:17,450 --> 00:00:19,040 Actually, let me write that down here. 6 00:00:19,040 --> 00:00:19,970 Control. 7 00:00:21,800 --> 00:00:22,190 Here. 8 00:00:25,640 --> 00:00:27,350 Control. 9 00:00:32,750 --> 00:00:33,920 Plus Z. 10 00:00:35,540 --> 00:00:43,610 Here, so you will want to press Ctrl Z to stop a foreground process and place it in the background. 11 00:00:43,610 --> 00:00:44,420 So let's try it. 12 00:00:44,420 --> 00:00:49,100 And at the command prompt here we will type the X logo. 13 00:00:49,190 --> 00:00:54,860 And here, as you can see, our X logo is opened right here now. 14 00:00:55,370 --> 00:00:59,360 And actually let's make it on the top so we will see what happens. 15 00:00:59,630 --> 00:01:02,000 Right now, always on top. 16 00:01:02,000 --> 00:01:04,160 Let's make it bigger here. 17 00:01:04,880 --> 00:01:08,150 So now let's press the Ctrl Z. 18 00:01:09,540 --> 00: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 19 00:01:18,390 --> 00:01:19,170 terminated. 20 00:01:19,290 --> 00:01:26,880 So after stopping X logo, we can verify that the program has stopped by attempting to resize. 21 00:01:27,420 --> 00:01:28,800 As you can you see here. 22 00:01:28,980 --> 00:01:29,700 Yeah. 23 00:01:30,270 --> 00:01:33,840 It's not behaving as like the previous example, right. 24 00:01:33,930 --> 00:01:36,420 So the program. 25 00:01:37,360 --> 00:01:41,860 Stopped, um, by at when we attempt to resize the logo window. 26 00:01:41,860 --> 00:01:44,530 So we will see that it appears quite dead. 27 00:01:44,560 --> 00:01:51,100 So we can either continue the program execution in the foreground using the FG command. 28 00:01:53,060 --> 00:01:58,850 Or resume the program's execution in the background with the BG command here actually now we will pray 29 00:01:58,880 --> 00:02:01,010 and we will pray another control here. 30 00:02:01,010 --> 00:02:03,890 It's almost suspended here, as you can see here. 31 00:02:03,890 --> 00:02:07,700 It will not print our appropriate X logo right here. 32 00:02:07,700 --> 00:02:11,060 And let's now use the BG here. 33 00:02:11,060 --> 00:02:13,880 And as you can see here, it is also. 34 00:02:15,980 --> 00:02:25,070 Provide from our background here, but now we can also interact when we write here by BG instead of 35 00:02:25,310 --> 00:02:28,280 FG, we can also interact with the Terminal Bash script. 36 00:02:28,280 --> 00:02:29,450 So that's it. 37 00:02:29,600 --> 00:02:36,470 So with the FG command, the job spec is optional if there is only one job. 38 00:02:36,470 --> 00:02:37,460 So moving. 39 00:02:37,580 --> 00: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 40 00:02:46,460 --> 00:02:49,370 would want to mention it, you will write background. 41 00:02:49,370 --> 00:02:52,490 Firstly, you will write jobs as we did in previous and here. 42 00:02:52,490 --> 00:02:52,730 Now. 43 00:02:52,730 --> 00:03:01,280 After that you will write BG and your job and as you can see here, job already in background. 44 00:03:02,080 --> 00:03:02,590 So. 45 00:03:03,760 --> 00:03:08,650 Moving a process from the foreground to background is handy if we launch a graphical program from the 46 00:03:08,650 --> 00:03:16,540 command line, but forget to place it in the background by appending the trailing and operator. 47 00:03:16,540 --> 00:03:20,890 So why would we want to launch a graphical program from the command line? 48 00:03:20,890 --> 00:03:22,900 So there are two reasons for that. 49 00:03:23,140 --> 00:03:30,430 The program you want to run might not be listed on the window manager menus such as X logon. 50 00:03:31,370 --> 00:03:32,000 Here. 51 00:03:33,410 --> 00:03:34,670 We don't have x logo, right? 52 00:03:35,090 --> 00:03:35,840 X logo. 53 00:03:36,720 --> 00:03:41,310 We just only have run X logo here, which is this is just a comment that runs like X logo. 54 00:03:42,210 --> 00:03:44,130 But we don't have any additional nexus. 55 00:03:44,170 --> 00:03:45,030 Actually, let me. 56 00:03:46,260 --> 00:03:48,750 Close this previous X logo here. 57 00:03:50,030 --> 00:03:50,450 Here. 58 00:03:51,360 --> 00:03:54,180 We don't have X logo in our program. 59 00:03:54,180 --> 00:04:00,780 So biological program from the command line, you might be able to see error messages that would otherwise 60 00:04:00,810 --> 00:04:04,040 be invisible if the program were launched graphically. 61 00:04:04,050 --> 00:04:09,600 So sometimes a program will fail to start up when launched from a graphical menu by launching it from 62 00:04:09,600 --> 00:04:10,440 the command line. 63 00:04:10,440 --> 00:04:14,050 Instead, you may see an error message that will reveal the problem. 64 00:04:14,070 --> 00:04:18,930 Also, some graphical programs have interesting and useful command line options.