WEBVTT

00:00.970 --> 00:03.490
So you can run commands at a prompt.

00:03.490 --> 00:05.290
But what is that prompt?

00:05.320 --> 00:06.610
Where does that come from?

00:06.610 --> 00:10.580
How are your commands going to run and why does it matter?

00:10.600 --> 00:14.160
You will get an answer for these questions in this lecture.

00:14.170 --> 00:15.240
My name is Stephan.

00:15.250 --> 00:17.110
Welcome to another lecture of our course.

00:17.110 --> 00:18.250
Let's get started.

00:30.720 --> 00:35.620
That little prompt is produced by a program called Shell.

00:35.640 --> 00:40.990
Let's actually get our diagram here so we can write things better on screen.

00:41.070 --> 00:48.450
So here so the so the little prompt is produced by a program called Shell.

00:53.650 --> 00:54.280
Shell.

00:54.520 --> 01:01.470
So it's a user interface that sits between you and the Linux interface here.

01:01.480 --> 01:08.080
So here, for example, in the left side is this is you here and here.

01:08.080 --> 01:10.840
This is our famous penguin.

01:10.840 --> 01:13.630
So I can draw Penguin right now, but I will try.

01:13.660 --> 01:14.710
Try here.

01:14.710 --> 01:18.100
So this is our penguin here.

01:20.720 --> 01:22.670
And here, This is our penguin.

01:22.670 --> 01:23.270
Yeah.

01:23.960 --> 01:24.530
Here.

01:24.530 --> 01:30.350
So this is the shell that sits between you and the Linux operating system.

01:30.350 --> 01:32.510
So Linux supplies several shells.

01:32.510 --> 01:38.930
And the most common and the standard for this course is called the bash shell.

01:38.930 --> 01:41.210
So actually, let's actually write this.

01:41.210 --> 01:47.840
So we're going to use that as Oops, yeah, now we're going to use that as a bash shell.

01:47.870 --> 01:54.860
BASH So this is just a standard that while most widely use shell type in Linux here, so Bash and other

01:54.860 --> 02:00.830
shells do much more than simply run commands, for example, for example, actually, let's delete this.

02:00.830 --> 02:01.370
Yeah.

02:01.400 --> 02:03.410
For example.

02:05.440 --> 02:07.750
When a command includes a wild card here.

02:07.750 --> 02:08.920
So this is a wild card.

02:09.640 --> 02:10.610
This is a wild card.

02:10.940 --> 02:11.560
Operator.

02:13.620 --> 02:16.110
Uh, this referred to multiple files at once.

02:16.110 --> 02:21.990
So for example, LHS here, LHS here in let's actually go to bin.

02:21.990 --> 02:24.720
So we have more files on bin here.

02:24.720 --> 02:27.210
So for example, LHS.

02:28.530 --> 02:30.300
Let's find the sea here.

02:30.300 --> 02:33.310
And as you can see, we get sea files.

02:33.390 --> 02:35.340
Not like this, LZ.

02:36.110 --> 02:36.590
Like this.

02:36.590 --> 02:40.280
And as you can see, no such file or directory.

02:40.830 --> 02:47.510
So, for example, the we access the multiple files at once, but in this case we don't have a C file

02:47.510 --> 02:47.840
here.

02:47.840 --> 02:52.970
So let's actually, instead of writing, uh, finding folders, let's go to Python here.

02:52.970 --> 02:57.320
So I think we're going to have Python three point.

02:58.310 --> 02:58.550
Trip.

02:58.580 --> 02:59.930
Python three point.

03:03.680 --> 03:04.580
Yeah, that's.

03:04.580 --> 03:06.770
That's actually fine.

03:06.770 --> 03:08.020
This here.

03:08.030 --> 03:08.870
Let's actually.

03:08.870 --> 03:10.040
Here, here, here.

03:10.250 --> 03:11.260
Open SSL.

03:11.270 --> 03:13.340
So let's go to open SSL.

03:13.370 --> 03:14.810
Open SSL, TLS.

03:14.810 --> 03:17.120
So let's look what we here.

03:17.150 --> 03:21.050
See the open SSL directory?

03:21.080 --> 03:21.470
Yeah.

03:21.510 --> 03:21.710
Open.

03:22.610 --> 03:23.900
Apparently the file.

03:24.230 --> 03:25.790
Yeah, that's it.

03:25.790 --> 03:30.860
So for example, ls something like that you're going to see all of this here.

03:30.860 --> 03:35.690
So the file wild card here, we will use the wild card in the next lectures too.

03:35.690 --> 03:40.850
So the wild card is a handled entirely by the shell, not by the program ls here.

03:40.850 --> 03:43.790
So the shell value is the expression here.

03:43.790 --> 03:51.200
For example, let's actually write this like a clear CD home and Carly.

03:51.230 --> 03:51.590
Oops.

03:52.010 --> 03:52.970
Carly here.

03:52.970 --> 03:53.720
So.

03:54.960 --> 03:56.990
If here, for example, LHS.

04:00.250 --> 04:02.140
Yeah, the R code here.

04:02.140 --> 04:05.380
The wildcard operator, for example, ls the.

04:07.440 --> 04:11.550
Dot py or LZ txt.

04:11.580 --> 04:12.570
We have txt files.

04:12.570 --> 04:12.840
Right?

04:12.840 --> 04:14.370
And as you can see we got on here.

04:14.370 --> 04:23.490
So if we copy this txt files right now and here let's open our text here right now.

04:23.700 --> 04:25.470
Axel txt copy copy here.

04:25.470 --> 04:26.130
Like this.

04:26.130 --> 04:27.720
So now.

04:27.720 --> 04:28.290
Yeah.

04:28.590 --> 04:29.100
Here.

04:29.100 --> 04:31.770
And as you can see, we got all the copies here.

04:31.770 --> 04:34.140
So here.

04:35.320 --> 04:36.520
The wild card.

04:37.280 --> 04:44.360
And as you can see here, the shell evaluates the expression the wild card operator, dot txt and invisible.

04:45.050 --> 04:50.680
Invisible replaces it with a list of matching file names before LHS runs.

04:50.690 --> 04:56.200
So in other words, LHS never sees the wild card here.

04:56.210 --> 05:03.410
So for the perspective of LHS, the type following command is going to be, for example, LHS, the

05:03.440 --> 05:04.040
Oxley.

05:05.210 --> 05:05.480
Oops.

05:05.480 --> 05:12.830
Actually, let's first say yeah, Oxley here, LHS Oxley copy, for example.

05:12.830 --> 05:16.730
Copy one and copy one.

05:16.760 --> 05:17.690
Yes.

05:20.390 --> 05:22.970
Or no, we don't have a copy ten for example.

05:22.970 --> 05:29.840
And after that TXT and then it comes Oxitec's or like Oxley again.

05:29.870 --> 05:30.380
Oxley.

05:31.230 --> 05:31.820
Copy.

05:31.850 --> 05:32.680
Oxley.

05:32.720 --> 05:33.590
Copy.

05:33.650 --> 05:34.370
TXT.

05:36.230 --> 05:37.520
Copy, for example.

05:37.520 --> 05:38.210
Yeah.

05:38.390 --> 05:40.490
8 or 6 here.

05:40.610 --> 05:42.290
Okay, so copy like this.

05:42.290 --> 05:44.300
And here, as you can see, we got an error.

05:44.300 --> 05:48.770
So our this wildcard operator sees like this.

05:48.770 --> 05:55.880
So the shell also handles pipes, as you saw in the first section of our this course.

05:55.880 --> 06:03.920
So it redirects the STD in an STD and transparently so the that the programs involves have no idea they

06:03.920 --> 06:05.780
are communicating with each other.

06:05.780 --> 06:13.660
So every time a command runs, some steps are the responsibility of the invoked programs such as LHS.

06:13.670 --> 06:17.360
So at some there are the responsibility.

06:18.770 --> 06:24.440
Uh, here are the responsible of the shell, so expert users understand which is which.

06:24.440 --> 06:31.430
So that's one reason they create a long, complex command of the top of their head and run them successfully.

06:31.430 --> 06:36.000
So they already know what the command will do before they pass.

06:36.000 --> 06:36.900
Uh, press enter.

06:36.900 --> 06:43.770
So in part because they understand that separation between shell and programs it invokes.

06:43.770 --> 06:47.340
So in this lecture we will launch you understanding of the Linux shell.

06:47.340 --> 06:53.160
I will take the same minimalistic approach I use for commands and pipes in previous lectures rather

06:53.160 --> 06:55.140
than cover dozens of shell features.

06:55.140 --> 07:02.610
And I will hand you just enough information to carry you to the next step of our learning journey.

07:02.610 --> 07:08.460
So in this lecture you will learn about the pattern matching for file names, you will learn redirection

07:08.460 --> 07:09.930
of input and outputs.

07:09.930 --> 07:15.990
You will learn variables to store valuables quoting and escaping to disable certain shell features.

07:15.990 --> 07:19.920
The search path for locating programs to run and you.

07:19.920 --> 07:24.240
Lastly, you will learn how to save changes to your shell environment.

07:24.240 --> 07:26.220
So I'm waiting you in the next lecture.

07:26.220 --> 07:27.120
See you later.
