WEBVTT

00:01.260 --> 00:06.630
Running processes in the background in Linux, whether you are working from the command line or the

00:06.630 --> 00:09.570
graphical user interface you're working with in a show.

00:10.020 --> 00:13.260
So all comments are thrown or executed from within the shell.

00:13.740 --> 00:18.330
So I mean, if they run from the graphical interface, then execute the command.

00:18.720 --> 00:24.210
The show waits until the command is completed before opening it under command prompt at times.

00:24.240 --> 00:29.730
Uh, you may want the process to run in the background rather than having to wait for it to complete

00:29.730 --> 00:30.360
in the terminal.

00:30.960 --> 00:37.830
For instance, say we want to work on a script in a text editor and so have called our text editor.

00:38.190 --> 00:42.030
In this case, our mouse pad by entering here mouse pad.

00:43.120 --> 00:51.130
Mousepad, for example, in the script here, as you can see here, we open it, but we cannot import

00:51.130 --> 00:54.080
any comments here.

00:54.640 --> 01:01.090
So in this case, the Basho will open the emails per text editor to create a new script here, as you

01:01.090 --> 01:01.810
can see here.

01:03.010 --> 01:09.640
Uh, so while we work in the text editor, the terminal is occupied with running the text editor.

01:09.940 --> 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,

01:17.500 --> 01:25.000
for example, unless like then we have no new prompt to allow us to enter more commands.

01:25.420 --> 01:28.570
So we called, of course, opening another terminal like that.

01:29.350 --> 01:30.370
Uh, and.

01:32.380 --> 01:34.320
Use this common sewer like that.

01:36.930 --> 01:37.500
And.

01:39.210 --> 01:45.540
But a better option to save resources and the screen real estate is to start a text editor running in

01:45.540 --> 01:46.230
the background.

01:47.230 --> 01:53.310
Uh, so running a person in the background simply means that it will continue to run without needing

01:53.310 --> 02:00.750
to needing the terminal in the swinging, the terminal is freed up for other other jobs and duties.

02:01.320 --> 02:03.540
So to start then takes editor in the background.

02:03.540 --> 02:06.000
Just opened an ampersand.

02:06.300 --> 02:07.800
Here, I will show you.

02:08.520 --> 02:15.390
So, uh, we deleted, um, closed our, uh, mouse pad here.

02:15.390 --> 02:17.700
So now, uh, for if we want to.

02:19.910 --> 02:24.920
Started texting during the background, just opened an ampersand to the end of the comment like that,

02:24.920 --> 02:28.120
for example, mousepad um.

02:29.680 --> 02:39.040
Example, uh, a text here and ad ampersand, um, here and enter.

02:39.490 --> 02:47.140
So as you can see here, we can see our society is three thousand two hundred eighteen and now we can

02:47.170 --> 02:48.670
use commands here.

02:48.880 --> 02:49.210
So.

02:49.840 --> 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

02:55.270 --> 03:01.660
enter other comments on our system while also editing our new script here.

03:01.940 --> 03:03.550
Uh, example text.

03:04.090 --> 03:09.850
So this is effective for any process that may run for a significant length of time.

03:10.240 --> 03:16.780
When you want to use HTML as a hacker, you will find this useful for running multiple terminals within

03:17.410 --> 03:20.920
multiple tasks to save resources and the screen space.

03:22.700 --> 03:29.090
Moving process to the foreground, if you want to move the process running in the background to the

03:29.090 --> 03:38.560
foreground, you can use the F G F G command so that if you command requires the process idea here.

03:39.440 --> 03:45.680
Uh, press side here and of the presses you want to return the foreground as shown here.

03:45.680 --> 03:51.190
For example, the twenty thousand two hundred eighteen here jab not found.

03:51.200 --> 04:04.040
So we will now find that these, uh, my examples and here, for example, uh, PSP is out here and

04:04.040 --> 04:06.500
grab examples here.

04:07.010 --> 04:11.660
Uh, this is the example of texts or three, uh, three thousand two hundred eighteen.

04:17.640 --> 04:19.170
Here so.

04:20.630 --> 04:23.040
If you don't know, they're here.

04:23.110 --> 04:26.160
Uh, this is the piece here.

04:26.180 --> 04:26.810
Three hundred.

04:35.570 --> 04:36.980
So you can see here.

04:43.750 --> 04:45.370
Like that, so.

04:46.620 --> 04:50.340
Now I want to show you the scheduling processes.

04:52.380 --> 04:55.020
So as a hacker, you're.

04:57.010 --> 05:04.330
Uh, what Linux system administrators and hackers often need to schedule this tool will run at a particular

05:04.330 --> 05:05.110
time of day.

05:05.890 --> 05:13.660
So a system administrator might want to schedule system backup to run every Saturday night at two a.m.,

05:14.290 --> 05:21.160
for example, a hacker might want to set a script to run the perform reconnaissance on a regular basis,

05:21.490 --> 05:23.860
finding open ports or vulnerabilities.

05:24.130 --> 05:34.660
So in Linux, you can accomplish this in at least two ways with add and uh, and current currently.

05:36.090 --> 05:43.310
We have two comments to do that, so the Ad Month is a damning e-book from Perseus, useful for scheduling

05:43.610 --> 05:47.100
a job to run once at some point in the future.

05:48.120 --> 05:54.660
The current deal is more suited for scheduling tasks to occur every day, every week, every month,

05:54.660 --> 05:58.200
and we will cover this in detail in later lectures.

05:58.800 --> 06:08.190
So we use the ATM at Diamond to schedule the execution of a program, our command or set of commands

06:08.190 --> 06:08.790
in the future.

06:09.120 --> 06:14.820
So the syntax is simply the at command, followed by the time to execute the process.

06:15.720 --> 06:20.370
The time argument can be provided by in various formats here, for example.

06:22.580 --> 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.

06:33.700 --> 06:45.910
So, for example, at seven, 12 p.m., for example, at seven, 20 p.m., June 25.

06:47.120 --> 06:50.960
And actually, uh, and it's I was twenty five.

06:52.820 --> 06:55.370
Know, for example, at noon.

06:56.500 --> 06:57.670
At noon.

06:58.630 --> 07:02.560
One, for example, or August 23.

07:03.750 --> 07:06.030
And two more road.

07:07.780 --> 07:08.850
At No.

07:09.070 --> 07:11.620
Plus 20 minutes.

07:13.490 --> 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.

07:29.990 --> 07:43.790
Uh, for example, uh, six or for example, September here, uh, September, uh, nineteen uh, in

07:43.940 --> 07:47.600
two thousand twenty, uh, twelve.

07:47.830 --> 07:49.970
Yeah, twenty twenty two here.

07:50.510 --> 07:57.230
So this is scheduled, uh, to run at seven twenty p.m. on the current day.

07:57.560 --> 08:04.300
This scheduled to run at seven, uh, twenty p.m. on August 25.

08:04.640 --> 08:07.010
This is scheduled to end around noon.

08:07.010 --> 08:17.360
This scheduled to run Aug. 23 and, uh, tomorrow and we can specify and, uh, uh, time as well.

08:17.750 --> 08:24.950
So, uh, when you enter the them on, uh, with the specified time at goes into interactive mode and

08:24.950 --> 08:27.500
you are greeted with an at prompt.

08:27.500 --> 08:33.290
So let's try it, for example, at seven.

08:34.630 --> 08:36.850
Uh, four to six.

08:39.560 --> 08:40.280
Let's hear.

08:41.540 --> 08:42.610
Yes, install it.

08:44.340 --> 08:46.500
Currently, my passport, yes.

08:50.730 --> 08:58.560
It may take some minutes, uh, so it's actually 50 megabytes here, so it will download now.

09:19.100 --> 09:29.120
Here at, uh, so at, uh, seven, four to seven, as you can see here now is four six.

09:29.630 --> 09:38.480
And now we will now use common sense, for example, road or, uh, for example, Ellis.

09:40.140 --> 09:40.590
So.

09:42.880 --> 09:45.040
Then it is a snippet.

09:46.050 --> 09:51.490
Uh, well executed here, for example, uh, see they here home.

09:53.420 --> 09:55.640
Like that, so.

09:57.560 --> 10:05.750
Managing processes in Linux is a is a key skill for every Linux user and hacker, so you must be able

10:05.750 --> 10:11.870
to leave, find, kill, prioritize and schedule processes to make sure Linux instance optimally.

10:12.500 --> 10:20.450
A hacker often will will need to find processes on the target so they want to kill, such as the antivirus

10:20.450 --> 10:28.100
software or a firewall, so they will also need to manage multiple processes in a reasoned attack and

10:28.100 --> 10:29.030
prioritize them.
