1 00:00:01,260 --> 00:00:06,630 Running processes in the background in Linux, whether you are working from the command line or the 2 00:00:06,630 --> 00:00:09,570 graphical user interface you're working with in a show. 3 00:00:10,020 --> 00:00:13,260 So all comments are thrown or executed from within the shell. 4 00:00:13,740 --> 00:00:18,330 So I mean, if they run from the graphical interface, then execute the command. 5 00:00:18,720 --> 00:00:24,210 The show waits until the command is completed before opening it under command prompt at times. 6 00:00:24,240 --> 00:00:29,730 Uh, you may want the process to run in the background rather than having to wait for it to complete 7 00:00:29,730 --> 00:00:30,360 in the terminal. 8 00:00:30,960 --> 00:00:37,830 For instance, say we want to work on a script in a text editor and so have called our text editor. 9 00:00:38,190 --> 00:00:42,030 In this case, our mouse pad by entering here mouse pad. 10 00:00:43,120 --> 00:00:51,130 Mousepad, for example, in the script here, as you can see here, we open it, but we cannot import 11 00:00:51,130 --> 00:00:54,080 any comments here. 12 00:00:54,640 --> 00:01:01,090 So in this case, the Basho will open the emails per text editor to create a new script here, as you 13 00:01:01,090 --> 00:01:01,810 can see here. 14 00:01:03,010 --> 00:01:09,640 Uh, so while we work in the text editor, the terminal is occupied with running the text editor. 15 00:01:09,940 --> 00:01:17,500 So if a return to the terminal and we shall see that is running our text editor and we have no new prompt, 16 00:01:17,500 --> 00:01:25,000 for example, unless like then we have no new prompt to allow us to enter more commands. 17 00:01:25,420 --> 00:01:28,570 So we called, of course, opening another terminal like that. 18 00:01:29,350 --> 00:01:30,370 Uh, and. 19 00:01:32,380 --> 00:01:34,320 Use this common sewer like that. 20 00:01:36,930 --> 00:01:37,500 And. 21 00:01:39,210 --> 00:01:45,540 But a better option to save resources and the screen real estate is to start a text editor running in 22 00:01:45,540 --> 00:01:46,230 the background. 23 00:01:47,230 --> 00:01:53,310 Uh, so running a person in the background simply means that it will continue to run without needing 24 00:01:53,310 --> 00:02:00,750 to needing the terminal in the swinging, the terminal is freed up for other other jobs and duties. 25 00:02:01,320 --> 00:02:03,540 So to start then takes editor in the background. 26 00:02:03,540 --> 00:02:06,000 Just opened an ampersand. 27 00:02:06,300 --> 00:02:07,800 Here, I will show you. 28 00:02:08,520 --> 00:02:15,390 So, uh, we deleted, um, closed our, uh, mouse pad here. 29 00:02:15,390 --> 00:02:17,700 So now, uh, for if we want to. 30 00:02:19,910 --> 00:02:24,920 Started texting during the background, just opened an ampersand to the end of the comment like that, 31 00:02:24,920 --> 00:02:28,120 for example, mousepad um. 32 00:02:29,680 --> 00:02:39,040 Example, uh, a text here and ad ampersand, um, here and enter. 33 00:02:39,490 --> 00:02:47,140 So as you can see here, we can see our society is three thousand two hundred eighteen and now we can 34 00:02:47,170 --> 00:02:48,670 use commands here. 35 00:02:48,880 --> 00:02:49,210 So. 36 00:02:49,840 --> 00:02:55,270 So now the text editor opens here like that's determined a lot of times a new comment prompt so we can 37 00:02:55,270 --> 00:03:01,660 enter other comments on our system while also editing our new script here. 38 00:03:01,940 --> 00:03:03,550 Uh, example text. 39 00:03:04,090 --> 00:03:09,850 So this is effective for any process that may run for a significant length of time. 40 00:03:10,240 --> 00:03:16,780 When you want to use HTML as a hacker, you will find this useful for running multiple terminals within 41 00:03:17,410 --> 00:03:20,920 multiple tasks to save resources and the screen space. 42 00:03:22,700 --> 00:03:29,090 Moving process to the foreground, if you want to move the process running in the background to the 43 00:03:29,090 --> 00:03:38,560 foreground, you can use the F G F G command so that if you command requires the process idea here. 44 00:03:39,440 --> 00:03:45,680 Uh, press side here and of the presses you want to return the foreground as shown here. 45 00:03:45,680 --> 00:03:51,190 For example, the twenty thousand two hundred eighteen here jab not found. 46 00:03:51,200 --> 00:04:04,040 So we will now find that these, uh, my examples and here, for example, uh, PSP is out here and 47 00:04:04,040 --> 00:04:06,500 grab examples here. 48 00:04:07,010 --> 00:04:11,660 Uh, this is the example of texts or three, uh, three thousand two hundred eighteen. 49 00:04:17,640 --> 00:04:19,170 Here so. 50 00:04:20,630 --> 00:04:23,040 If you don't know, they're here. 51 00:04:23,110 --> 00:04:26,160 Uh, this is the piece here. 52 00:04:26,180 --> 00:04:26,810 Three hundred. 53 00:04:35,570 --> 00:04:36,980 So you can see here. 54 00:04:43,750 --> 00:04:45,370 Like that, so. 55 00:04:46,620 --> 00:04:50,340 Now I want to show you the scheduling processes. 56 00:04:52,380 --> 00:04:55,020 So as a hacker, you're. 57 00:04:57,010 --> 00:05:04,330 Uh, what Linux system administrators and hackers often need to schedule this tool will run at a particular 58 00:05:04,330 --> 00:05:05,110 time of day. 59 00:05:05,890 --> 00:05:13,660 So a system administrator might want to schedule system backup to run every Saturday night at two a.m., 60 00:05:14,290 --> 00:05:21,160 for example, a hacker might want to set a script to run the perform reconnaissance on a regular basis, 61 00:05:21,490 --> 00:05:23,860 finding open ports or vulnerabilities. 62 00:05:24,130 --> 00:05:34,660 So in Linux, you can accomplish this in at least two ways with add and uh, and current currently. 63 00:05:36,090 --> 00:05:43,310 We have two comments to do that, so the Ad Month is a damning e-book from Perseus, useful for scheduling 64 00:05:43,610 --> 00:05:47,100 a job to run once at some point in the future. 65 00:05:48,120 --> 00:05:54,660 The current deal is more suited for scheduling tasks to occur every day, every week, every month, 66 00:05:54,660 --> 00:05:58,200 and we will cover this in detail in later lectures. 67 00:05:58,800 --> 00:06:08,190 So we use the ATM at Diamond to schedule the execution of a program, our command or set of commands 68 00:06:08,190 --> 00:06:08,790 in the future. 69 00:06:09,120 --> 00:06:14,820 So the syntax is simply the at command, followed by the time to execute the process. 70 00:06:15,720 --> 00:06:20,370 The time argument can be provided by in various formats here, for example. 71 00:06:22,580 --> 00:06:29,320 What we can do like that, and it's open this, so this will be useful, and I will show how this looks. 72 00:06:33,700 --> 00:06:45,910 So, for example, at seven, 12 p.m., for example, at seven, 20 p.m., June 25. 73 00:06:47,120 --> 00:06:50,960 And actually, uh, and it's I was twenty five. 74 00:06:52,820 --> 00:06:55,370 Know, for example, at noon. 75 00:06:56,500 --> 00:06:57,670 At noon. 76 00:06:58,630 --> 00:07:02,560 One, for example, or August 23. 77 00:07:03,750 --> 00:07:06,030 And two more road. 78 00:07:07,780 --> 00:07:08,850 At No. 79 00:07:09,070 --> 00:07:11,620 Plus 20 minutes. 80 00:07:13,490 --> 00:07:29,390 That's now put hours, 10 hours at now, plus five days at now, plus three weeks and at 7:20 pm. 81 00:07:29,990 --> 00:07:43,790 Uh, for example, uh, six or for example, September here, uh, September, uh, nineteen uh, in 82 00:07:43,940 --> 00:07:47,600 two thousand twenty, uh, twelve. 83 00:07:47,830 --> 00:07:49,970 Yeah, twenty twenty two here. 84 00:07:50,510 --> 00:07:57,230 So this is scheduled, uh, to run at seven twenty p.m. on the current day. 85 00:07:57,560 --> 00:08:04,300 This scheduled to run at seven, uh, twenty p.m. on August 25. 86 00:08:04,640 --> 00:08:07,010 This is scheduled to end around noon. 87 00:08:07,010 --> 00:08:17,360 This scheduled to run Aug. 23 and, uh, tomorrow and we can specify and, uh, uh, time as well. 88 00:08:17,750 --> 00:08:24,950 So, uh, when you enter the them on, uh, with the specified time at goes into interactive mode and 89 00:08:24,950 --> 00:08:27,500 you are greeted with an at prompt. 90 00:08:27,500 --> 00:08:33,290 So let's try it, for example, at seven. 91 00:08:34,630 --> 00:08:36,850 Uh, four to six. 92 00:08:39,560 --> 00:08:40,280 Let's hear. 93 00:08:41,540 --> 00:08:42,610 Yes, install it. 94 00:08:44,340 --> 00:08:46,500 Currently, my passport, yes. 95 00:08:50,730 --> 00:08:58,560 It may take some minutes, uh, so it's actually 50 megabytes here, so it will download now. 96 00:09:19,100 --> 00:09:29,120 Here at, uh, so at, uh, seven, four to seven, as you can see here now is four six. 97 00:09:29,630 --> 00:09:38,480 And now we will now use common sense, for example, road or, uh, for example, Ellis. 98 00:09:40,140 --> 00:09:40,590 So. 99 00:09:42,880 --> 00:09:45,040 Then it is a snippet. 100 00:09:46,050 --> 00:09:51,490 Uh, well executed here, for example, uh, see they here home. 101 00:09:53,420 --> 00:09:55,640 Like that, so. 102 00:09:57,560 --> 00:10:05,750 Managing processes in Linux is a is a key skill for every Linux user and hacker, so you must be able 103 00:10:05,750 --> 00:10:11,870 to leave, find, kill, prioritize and schedule processes to make sure Linux instance optimally. 104 00:10:12,500 --> 00:10:20,450 A hacker often will will need to find processes on the target so they want to kill, such as the antivirus 105 00:10:20,450 --> 00:10:28,100 software or a firewall, so they will also need to manage multiple processes in a reasoned attack and 106 00:10:28,100 --> 00:10:29,030 prioritize them.