1
00:00:00,970 --> 00:00:03,490
So you can run commands at a prompt.

2
00:00:03,490 --> 00:00:05,290
But what is that prompt?

3
00:00:05,320 --> 00:00:06,610
Where does that come from?

4
00:00:06,610 --> 00:00:10,580
How are your commands going to run and why does it matter?

5
00:00:10,600 --> 00:00:14,160
You will get an answer for these questions in this lecture.

6
00:00:14,170 --> 00:00:15,240
My name is Stephan.

7
00:00:15,250 --> 00:00:17,110
Welcome to another lecture of our course.

8
00:00:17,110 --> 00:00:18,250
Let's get started.

9
00:00:30,720 --> 00:00:35,620
That little prompt is produced by a program called Shell.

10
00:00:35,640 --> 00:00:40,990
Let's actually get our diagram here so we can write things better on screen.

11
00:00:41,070 --> 00:00:48,450
So here so the so the little prompt is produced by a program called Shell.

12
00:00:53,650 --> 00:00:54,280
Shell.

13
00:00:54,520 --> 00:01:01,470
So it's a user interface that sits between you and the Linux interface here.

14
00:01:01,480 --> 00:01:08,080
So here, for example, in the left side is this is you here and here.

15
00:01:08,080 --> 00:01:10,840
This is our famous penguin.

16
00:01:10,840 --> 00:01:13,630
So I can draw Penguin right now, but I will try.

17
00:01:13,660 --> 00:01:14,710
Try here.

18
00:01:14,710 --> 00:01:18,100
So this is our penguin here.

19
00:01:20,720 --> 00:01:22,670
And here, This is our penguin.

20
00:01:22,670 --> 00:01:23,270
Yeah.

21
00:01:23,960 --> 00:01:24,530
Here.

22
00:01:24,530 --> 00:01:30,350
So this is the shell that sits between you and the Linux operating system.

23
00:01:30,350 --> 00:01:32,510
So Linux supplies several shells.

24
00:01:32,510 --> 00:01:38,930
And the most common and the standard for this course is called the bash shell.

25
00:01:38,930 --> 00:01:41,210
So actually, let's actually write this.

26
00:01:41,210 --> 00:01:47,840
So we're going to use that as Oops, yeah, now we're going to use that as a bash shell.

27
00:01:47,870 --> 00:01:54,860
BASH So this is just a standard that while most widely use shell type in Linux here, so Bash and other

28
00:01:54,860 --> 00:02:00,830
shells do much more than simply run commands, for example, for example, actually, let's delete this.

29
00:02:00,830 --> 00:02:01,370
Yeah.

30
00:02:01,400 --> 00:02:03,410
For example.

31
00:02:05,440 --> 00:02:07,750
When a command includes a wild card here.

32
00:02:07,750 --> 00:02:08,920
So this is a wild card.

33
00:02:09,640 --> 00:02:10,610
This is a wild card.

34
00:02:10,940 --> 00:02:11,560
Operator.

35
00:02:13,620 --> 00:02:16,110
Uh, this referred to multiple files at once.

36
00:02:16,110 --> 00:02:21,990
So for example, LHS here, LHS here in let's actually go to bin.

37
00:02:21,990 --> 00:02:24,720
So we have more files on bin here.

38
00:02:24,720 --> 00:02:27,210
So for example, LHS.

39
00:02:28,530 --> 00:02:30,300
Let's find the sea here.

40
00:02:30,300 --> 00:02:33,310
And as you can see, we get sea files.

41
00:02:33,390 --> 00:02:35,340
Not like this, LZ.

42
00:02:36,110 --> 00:02:36,590
Like this.

43
00:02:36,590 --> 00:02:40,280
And as you can see, no such file or directory.

44
00:02:40,830 --> 00: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

45
00:02:47,510 --> 00:02:47,840
here.

46
00:02:47,840 --> 00:02:52,970
So let's actually, instead of writing, uh, finding folders, let's go to Python here.

47
00:02:52,970 --> 00:02:57,320
So I think we're going to have Python three point.

48
00:02:58,310 --> 00:02:58,550
Trip.

49
00:02:58,580 --> 00:02:59,930
Python three point.

50
00:03:03,680 --> 00:03:04,580
Yeah, that's.

51
00:03:04,580 --> 00:03:06,770
That's actually fine.

52
00:03:06,770 --> 00:03:08,020
This here.

53
00:03:08,030 --> 00:03:08,870
Let's actually.

54
00:03:08,870 --> 00:03:10,040
Here, here, here.

55
00:03:10,250 --> 00:03:11,260
Open SSL.

56
00:03:11,270 --> 00:03:13,340
So let's go to open SSL.

57
00:03:13,370 --> 00:03:14,810
Open SSL, TLS.

58
00:03:14,810 --> 00:03:17,120
So let's look what we here.

59
00:03:17,150 --> 00:03:21,050
See the open SSL directory?

60
00:03:21,080 --> 00:03:21,470
Yeah.

61
00:03:21,510 --> 00:03:21,710
Open.

62
00:03:22,610 --> 00:03:23,900
Apparently the file.

63
00:03:24,230 --> 00:03:25,790
Yeah, that's it.

64
00:03:25,790 --> 00:03:30,860
So for example, ls something like that you're going to see all of this here.

65
00:03:30,860 --> 00:03:35,690
So the file wild card here, we will use the wild card in the next lectures too.

66
00:03:35,690 --> 00:03:40,850
So the wild card is a handled entirely by the shell, not by the program ls here.

67
00:03:40,850 --> 00:03:43,790
So the shell value is the expression here.

68
00:03:43,790 --> 00:03:51,200
For example, let's actually write this like a clear CD home and Carly.

69
00:03:51,230 --> 00:03:51,590
Oops.

70
00:03:52,010 --> 00:03:52,970
Carly here.

71
00:03:52,970 --> 00:03:53,720
So.

72
00:03:54,960 --> 00:03:56,990
If here, for example, LHS.

73
00:04:00,250 --> 00:04:02,140
Yeah, the R code here.

74
00:04:02,140 --> 00:04:05,380
The wildcard operator, for example, ls the.

75
00:04:07,440 --> 00:04:11,550
Dot py or LZ txt.

76
00:04:11,580 --> 00:04:12,570
We have txt files.

77
00:04:12,570 --> 00:04:12,840
Right?

78
00:04:12,840 --> 00:04:14,370
And as you can see we got on here.

79
00:04:14,370 --> 00:04:23,490
So if we copy this txt files right now and here let's open our text here right now.

80
00:04:23,700 --> 00:04:25,470
Axel txt copy copy here.

81
00:04:25,470 --> 00:04:26,130
Like this.

82
00:04:26,130 --> 00:04:27,720
So now.

83
00:04:27,720 --> 00:04:28,290
Yeah.

84
00:04:28,590 --> 00:04:29,100
Here.

85
00:04:29,100 --> 00:04:31,770
And as you can see, we got all the copies here.

86
00:04:31,770 --> 00:04:34,140
So here.

87
00:04:35,320 --> 00:04:36,520
The wild card.

88
00:04:37,280 --> 00:04:44,360
And as you can see here, the shell evaluates the expression the wild card operator, dot txt and invisible.

89
00:04:45,050 --> 00:04:50,680
Invisible replaces it with a list of matching file names before LHS runs.

90
00:04:50,690 --> 00:04:56,200
So in other words, LHS never sees the wild card here.

91
00:04:56,210 --> 00:05:03,410
So for the perspective of LHS, the type following command is going to be, for example, LHS, the

92
00:05:03,440 --> 00:05:04,040
Oxley.

93
00:05:05,210 --> 00:05:05,480
Oops.

94
00:05:05,480 --> 00:05:12,830
Actually, let's first say yeah, Oxley here, LHS Oxley copy, for example.

95
00:05:12,830 --> 00:05:16,730
Copy one and copy one.

96
00:05:16,760 --> 00:05:17,690
Yes.

97
00:05:20,390 --> 00:05:22,970
Or no, we don't have a copy ten for example.

98
00:05:22,970 --> 00:05:29,840
And after that TXT and then it comes Oxitec's or like Oxley again.

99
00:05:29,870 --> 00:05:30,380
Oxley.

100
00:05:31,230 --> 00:05:31,820
Copy.

101
00:05:31,850 --> 00:05:32,680
Oxley.

102
00:05:32,720 --> 00:05:33,590
Copy.

103
00:05:33,650 --> 00:05:34,370
TXT.

104
00:05:36,230 --> 00:05:37,520
Copy, for example.

105
00:05:37,520 --> 00:05:38,210
Yeah.

106
00:05:38,390 --> 00:05:40,490
8 or 6 here.

107
00:05:40,610 --> 00:05:42,290
Okay, so copy like this.

108
00:05:42,290 --> 00:05:44,300
And here, as you can see, we got an error.

109
00:05:44,300 --> 00:05:48,770
So our this wildcard operator sees like this.

110
00:05:48,770 --> 00:05:55,880
So the shell also handles pipes, as you saw in the first section of our this course.

111
00:05:55,880 --> 00:06:03,920
So it redirects the STD in an STD and transparently so the that the programs involves have no idea they

112
00:06:03,920 --> 00:06:05,780
are communicating with each other.

113
00:06:05,780 --> 00:06:13,660
So every time a command runs, some steps are the responsibility of the invoked programs such as LHS.

114
00:06:13,670 --> 00:06:17,360
So at some there are the responsibility.

115
00:06:18,770 --> 00:06:24,440
Uh, here are the responsible of the shell, so expert users understand which is which.

116
00:06:24,440 --> 00:06:31,430
So that's one reason they create a long, complex command of the top of their head and run them successfully.

117
00:06:31,430 --> 00:06:36,000
So they already know what the command will do before they pass.

118
00:06:36,000 --> 00:06:36,900
Uh, press enter.

119
00:06:36,900 --> 00:06:43,770
So in part because they understand that separation between shell and programs it invokes.

120
00:06:43,770 --> 00:06:47,340
So in this lecture we will launch you understanding of the Linux shell.

121
00:06:47,340 --> 00:06:53,160
I will take the same minimalistic approach I use for commands and pipes in previous lectures rather

122
00:06:53,160 --> 00:06:55,140
than cover dozens of shell features.

123
00:06:55,140 --> 00:07:02,610
And I will hand you just enough information to carry you to the next step of our learning journey.

124
00:07:02,610 --> 00:07:08,460
So in this lecture you will learn about the pattern matching for file names, you will learn redirection

125
00:07:08,460 --> 00:07:09,930
of input and outputs.

126
00:07:09,930 --> 00:07:15,990
You will learn variables to store valuables quoting and escaping to disable certain shell features.

127
00:07:15,990 --> 00:07:19,920
The search path for locating programs to run and you.

128
00:07:19,920 --> 00:07:24,240
Lastly, you will learn how to save changes to your shell environment.

129
00:07:24,240 --> 00:07:26,220
So I'm waiting you in the next lecture.

130
00:07:26,220 --> 00:07:27,120
See you later.
