WEBVTT - This file was automatically generated by VIMEO

0
00:00:08.600 --> 00:00:11.100
Welcome to section 4 in this section. You will learn about

1
00:00:11.100 --> 00:00:14.800
 Linux Administration using your newly created ec2 instance. We

2
00:00:14.800 --> 00:00:17.800
 will discuss topics such as files and directories users and

3
00:00:17.800 --> 00:00:20.700
 groups service and package management and running

4
00:00:20.700 --> 00:00:21.200
 containers.

5
00:00:23.400 --> 00:00:26.500
In this video you jump back into the terminal and explore

6
00:00:26.500 --> 00:00:27.600
 the Linux file system.

7
00:00:28.900 --> 00:00:31.800
Our plan is explore the Linux file system hierarchy standard

8
00:00:31.800 --> 00:00:34.200
 or FHS. So please make sure you're

9
00:00:34.200 --> 00:00:37.200
 still SSH into your host. If not, please just

10
00:00:37.200 --> 00:00:37.700
 so now.

11
00:00:38.600 --> 00:00:41.300
We will learn about some commands that will help you to verse the

12
00:00:41.300 --> 00:00:42.000
 Linux file system.

13
00:00:42.800 --> 00:00:45.500
Next you will spelunk your way through the file system

14
00:00:45.500 --> 00:00:48.200
 starting with a top level and work your way down to the

15
00:00:48.200 --> 00:00:51.000
 most common ones. You should know. Okay, let's get started.

16
00:00:52.700 --> 00:00:55.300
Okay. So here we are back in the terminal and we're

17
00:00:55.300 --> 00:00:58.100
 gonna discuss. Like I said in the intro that we're going

18
00:00:58.100 --> 00:01:01.700
 to discuss the file system hierarchy and these

19
00:01:01.700 --> 00:01:04.400
 are basically all the directories and files that make up your Linux

20
00:01:04.400 --> 00:01:05.300
 operating system.

21
00:01:06.200 --> 00:01:10.000
So there are quite a bit to go over. So I've

22
00:01:09.800 --> 00:01:13.600
 simplified this a little bit by choosing nine

23
00:01:12.600 --> 00:01:15.600
 that we could talk to one being

24
00:01:15.600 --> 00:01:18.300
 the top level and then eight subdirectories that

25
00:01:18.300 --> 00:01:21.200
 that I think will be enough foundational for you to be up and

26
00:01:21.200 --> 00:01:21.400
 running.

27
00:01:22.500 --> 00:01:25.500
If you wanted to learn more though, however, there's a

28
00:01:25.500 --> 00:01:28.200
 great way you could do that actually rate here on your computer. Radon your

29
00:01:28.200 --> 00:01:32.000
 ec2 instance or on any Linux computer for that matter. There's a

30
00:01:31.200 --> 00:01:34.300
 command called man and what man stands for

31
00:01:34.300 --> 00:01:37.400
 is manual and what that is is it

32
00:01:37.400 --> 00:01:40.500
 basically is documentation or manual pages right

33
00:01:40.500 --> 00:01:43.500
 here on your Linux host and what we're looking for is a

34
00:01:43.500 --> 00:01:46.900
 command as a manual entry called hire. So in

35
00:01:46.900 --> 00:01:49.900
 your terminal if you type the word man space

36
00:01:49.900 --> 00:01:52.400
 and then hire what this should

37
00:01:52.400 --> 00:01:54.700
 give us is the hierarchy file system.

38
00:01:55.400 --> 00:01:58.100
And if you I hit enter you can see here. This gives us

39
00:01:58.100 --> 00:02:01.400
 all the directories inside your Linux file

40
00:02:01.400 --> 00:02:04.500
 system and what they're used for and so

41
00:02:04.500 --> 00:02:07.600
 this is the FHS guidelines that are set that

42
00:02:07.600 --> 00:02:10.300
 this directory should be used for this and these files and this creates

43
00:02:10.300 --> 00:02:12.800
 a standard amongst all the Linux distributions.

44
00:02:13.600 --> 00:02:16.100
So I'd like I said, I'm not gonna go through all of them here, but I want you to know

45
00:02:16.100 --> 00:02:19.200
 this is here. So if you did want to actually look through all

46
00:02:19.200 --> 00:02:22.300
 these you could and learn more so I'm gonna hit cue to

47
00:02:22.300 --> 00:02:25.300
 quit to get out of here. Okay, so there's two commands

48
00:02:25.300 --> 00:02:28.200
 that we're gonna need to Traverse our Linux file

49
00:02:28.200 --> 00:02:31.500
 system. So the first command is LS which basically lists

50
00:02:31.500 --> 00:02:34.300
 the contents of a directory and the

51
00:02:34.300 --> 00:02:38.300
 other command is CD which allows you to change directory to

52
00:02:37.300 --> 00:02:40.200
 another directory in your

53
00:02:40.200 --> 00:02:43.100
 file system. Let's get started with there. The first

54
00:02:43.100 --> 00:02:46.700
 thing we're gonna do is we're gonna change directory into our root file

55
00:02:46.700 --> 00:02:46.800
 system.

56
00:02:47.800 --> 00:02:50.500
Which is the top level of all the five of

57
00:02:50.500 --> 00:02:53.500
 all the directories and so to do that you're going to type the command

58
00:02:53.500 --> 00:02:56.500
 CD space and then a forward slash. And so

59
00:02:56.500 --> 00:02:59.500
 this is gonna change our current directory into

60
00:02:59.500 --> 00:03:02.300
 the root file system directory.

61
00:03:03.100 --> 00:03:06.300
And so we know where there because you be is denoted by

62
00:03:06.300 --> 00:03:09.300
 after the ec2. User prompt is a slash

63
00:03:09.300 --> 00:03:12.100
 now rate before the dollar sign. So there we are.

64
00:03:12.100 --> 00:03:15.200
 The next thing I'm going to do is use LS to list the contents of

65
00:03:15.200 --> 00:03:15.700
 this Direct.

66
00:03:16.800 --> 00:03:20.100
And here we are in the root file

67
00:03:19.100 --> 00:03:22.800
 system. There are a whole bunch of other directories

68
00:03:22.800 --> 00:03:25.200
 as you would think, you know, you could think of the file system

69
00:03:25.200 --> 00:03:28.300
 as a tree and they're all connected here. So like I

70
00:03:28.300 --> 00:03:31.100
 said earlier, we're just gonna go over a few that I've

71
00:03:31.100 --> 00:03:34.400
 picked we've talked about the root file system hierarchy and

72
00:03:34.400 --> 00:03:38.200
 how it's the top level and where everything is Branched from

73
00:03:38.200 --> 00:03:41.100
 beneath this the next one I want

74
00:03:41.100 --> 00:03:42.300
 to talk about is the boot Direct.

75
00:03:43.100 --> 00:03:46.300
And so the boot directory contains static files

76
00:03:46.300 --> 00:03:49.100
 that needed to help boot the OS you'll find stuff like the

77
00:03:49.100 --> 00:03:52.000
 initram file system and possibly the kernel.

78
00:03:52.800 --> 00:03:55.400
So to inspect the contents

79
00:03:55.400 --> 00:03:58.700
 of the boot directory, we're going to once again type the ls

80
00:03:58.700 --> 00:03:59.000
 command.

81
00:03:59.700 --> 00:04:02.900
With the space and then we're gonna use the we

82
00:04:02.900 --> 00:04:05.400
 type in the name of the directory. We want to look in which

83
00:04:05.400 --> 00:04:08.200
 is boot here with a slash. We want to look in

84
00:04:08.200 --> 00:04:10.000
 the contents of the boot subdirector.

85
00:04:10.800 --> 00:04:13.500
Okay. So here we are. We see

86
00:04:13.500 --> 00:04:16.200
 the contents of the boot directory. You can see there's The Inn at

87
00:04:16.200 --> 00:04:20.000
 Ram file system. There's the grub to directory which is our bootloader and

88
00:04:19.400 --> 00:04:22.300
 there's a few other files here. Don't worry

89
00:04:22.300 --> 00:04:25.500
 about what these files do it's not important for this course, but

90
00:04:25.500 --> 00:04:28.300
 just know that the boot directory is what makes your OS

91
00:04:28.300 --> 00:04:31.300
 possible to boot into all the files

92
00:04:31.300 --> 00:04:34.300
 and information are here so I'm gonna clear the screen.

93
00:04:34.300 --> 00:04:37.400
 So it's easy to keep following along I will list

94
00:04:37.400 --> 00:04:40.100
 the contents of the high level directory again,

95
00:04:40.100 --> 00:04:42.300
 so you can just have a visual there as we go through these

96
00:04:43.500 --> 00:04:46.600
the next directory we want to talk about is the bin director the

97
00:04:46.600 --> 00:04:50.000
 bin directory contains executables that are used by both administrators

98
00:04:49.300 --> 00:04:52.300
 and standard users alike. For example,

99
00:04:52.300 --> 00:04:55.200
 the ls command that we're using right now is actually located in

100
00:04:55.200 --> 00:04:56.300
 the in this bin Direct.

101
00:04:56.900 --> 00:04:59.100
So while once again, we're gonna go

102
00:04:59.100 --> 00:05:02.200
 ahead and we're gonna look in the directory. I'm gonna type LS space and

103
00:05:02.200 --> 00:05:04.100
 the directory. I want to look at which is been

104
00:05:05.200 --> 00:05:08.400
And hit enter so as you can see a whole bunch

105
00:05:08.400 --> 00:05:11.300
 of files when past the screen and this is

106
00:05:11.300 --> 00:05:14.700
 because there's a lot of executables inside the bin directory. We're

107
00:05:14.700 --> 00:05:17.100
 not going to go over all of them. There's quite a

108
00:05:17.100 --> 00:05:17.500
 bit in here.

109
00:05:18.200 --> 00:05:21.500
The ls is in here python 3.7 command

110
00:05:21.500 --> 00:05:25.200
 is in here and and another commands like that. So obviously

111
00:05:24.200 --> 00:05:27.200
 if you're running any commands

112
00:05:27.200 --> 00:05:30.200
 in your spelunking 3 system, you want

113
00:05:30.200 --> 00:05:33.200
 to be able to have access to the bin directory? Okay, so let me

114
00:05:33.200 --> 00:05:34.100
 clear the screen here.

115
00:05:35.100 --> 00:05:38.300
I'm gonna list the higher the top level again.

116
00:05:38.300 --> 00:05:41.100
 So it's just easy to visualize and the next director we're gonna

117
00:05:41.100 --> 00:05:42.800
 go to is the Espin directory.

118
00:05:43.400 --> 00:05:47.200
So I'm going to go ahead and Espen

119
00:05:46.200 --> 00:05:49.500
 LS. So before I

120
00:05:49.500 --> 00:05:52.300
 assure the contents the this directory holds

121
00:05:52.300 --> 00:05:55.200
 executables that are meant for restoring repairing or

122
00:05:55.200 --> 00:05:58.100
 recovering the file system. You'll find commands in here

123
00:05:58.100 --> 00:06:01.100
 like reboot in fdisk if this is used to work

124
00:06:01.100 --> 00:06:04.500
 with local disks, so let's go ahead and we'll

125
00:06:04.500 --> 00:06:07.900
 list the contents of the s-spin directory. So as

126
00:06:07.900 --> 00:06:10.900
 you can see a lot of binaries just

127
00:06:10.900 --> 00:06:12.400
 like we saw on the bin directory.

128
00:06:13.100 --> 00:06:16.500
You know, the only difference is these are more used for the system

129
00:06:16.500 --> 00:06:19.600
 and system administrators. Whereas the bin directory

130
00:06:19.600 --> 00:06:22.700
 is a little bit of mixture of Administrators and standard uses alike.

131
00:06:23.300 --> 00:06:26.800
Okay, so let me go ahead and clear the screen. I will

132
00:06:26.800 --> 00:06:29.100
 once again print the top level so you

133
00:06:29.100 --> 00:06:32.500
 can follow along easier and the next directory we're gonna discuss

134
00:06:32.500 --> 00:06:35.600
 is the ETC directory or the

135
00:06:35.200 --> 00:06:38.200
 ETC directory. You may hear it called

136
00:06:38.700 --> 00:06:39.100
 Etsy as well.

137
00:06:39.900 --> 00:06:42.400
It doesn't seem to be any real

138
00:06:42.400 --> 00:06:45.000
 guide on which one to use.

139
00:06:46.100 --> 00:06:49.400
I kind of use them interchangeably where I use it. Sometimes I say Etsy

140
00:06:49.400 --> 00:06:52.100
 and sometimes I say Etc but the original meaning of

141
00:06:52.100 --> 00:06:55.500
 the directory is ETC and so the ETC directory

142
00:06:55.500 --> 00:06:58.700
 contains configuration files for all your application and

143
00:06:58.700 --> 00:07:01.500
 system apps and you'll find stuff and

144
00:07:01.500 --> 00:07:04.500
 you're like the user file the Quran configuration

145
00:07:04.500 --> 00:07:07.000
 file and a host.com file.

146
00:07:07.800 --> 00:07:10.400
So let's go ahead and list the contents like

147
00:07:10.400 --> 00:07:13.800
 we have before LS space the directory

148
00:07:13.800 --> 00:07:15.500
 we want to and then hit return.

149
00:07:16.900 --> 00:07:19.400
Okay. So this is all the

150
00:07:19.400 --> 00:07:23.000
 basic configuration files right now on this ec2 instance.

151
00:07:24.500 --> 00:07:27.500
So if you ever install an application most likely

152
00:07:27.500 --> 00:07:30.000
 to configuration file end up here. So if you ever need to make

153
00:07:30.300 --> 00:07:33.800
 any change and configuration you want to come inside this directory and the

154
00:07:33.800 --> 00:07:36.900
 format is like Etc slash application name

155
00:07:36.900 --> 00:07:38.800
 slash and then whatever the config file is.

156
00:07:39.700 --> 00:07:41.800
But as you see I mentioned cron earlier.

157
00:07:42.600 --> 00:07:45.300
You can see here. They have The Chronic configuration

158
00:07:45.300 --> 00:07:45.900
 files.

159
00:07:46.700 --> 00:07:49.500
You all this over here. You have the user

160
00:07:49.500 --> 00:07:52.200
 the password file. There's a group file in here.

161
00:07:52.200 --> 00:07:55.200
 Those are files will touch in later videos, but just know that

162
00:07:55.200 --> 00:07:56.000
 this is where they're at.

163
00:07:56.600 --> 00:07:57.800
All right. Let me clear the screen.

164
00:07:59.100 --> 00:08:02.000
List the top level and the next one we're gonna look

165
00:08:02.100 --> 00:08:05.100
 at is the proc direct. So the proc directory is a

166
00:08:05.100 --> 00:08:08.500
 little different than the other ones. The proc directory is a pseudo virtual directory

167
00:08:08.500 --> 00:08:11.200
 where the other ones actually have files on disk. This one is

168
00:08:11.200 --> 00:08:14.700
 is like I said is virtual and so the proc

169
00:08:14.700 --> 00:08:17.200
 directory contains information about all the

170
00:08:17.200 --> 00:08:20.100
 running processes in kernel settings that are

171
00:08:20.100 --> 00:08:23.300
 on your computer. So some of the things you can look at in the proc file

172
00:08:23.300 --> 00:08:26.400
 or CPU information or memory. So let's

173
00:08:26.400 --> 00:08:29.400
 go ahead and let's list the contents of the proc file.

174
00:08:29.400 --> 00:08:32.300
 So LS and the proc directory and then enter

175
00:08:33.300 --> 00:08:36.200
And here you can see all the way to the left you see the

176
00:08:36.200 --> 00:08:39.500
 in the digit directory the digit named

177
00:08:39.500 --> 00:08:43.100
 entities right there. Those are actually process IDs.

178
00:08:42.100 --> 00:08:45.500
 And so if you wanted to look inside of

179
00:08:45.500 --> 00:08:48.400
 you those each process has a specific set

180
00:08:48.400 --> 00:08:51.100
 of files in other sub directors you go to you can see

181
00:08:51.100 --> 00:08:54.300
 up there. The one process ID one is actually

182
00:08:54.300 --> 00:08:57.800
 the first process that get started when your Linux boots, but for

183
00:08:57.800 --> 00:09:00.600
 example, you can see that there's a CPU info file

184
00:09:00.600 --> 00:09:03.600
 right there. And I'm gonna use the cat command here.

185
00:09:03.600 --> 00:09:06.400
 What I want to do is I want to print the contents of this file

186
00:09:06.400 --> 00:09:09.200
 out to standard out and you can use the cat command for that and

187
00:09:09.200 --> 00:09:12.200
 the cat is just cat and then the file you want to

188
00:09:12.200 --> 00:09:15.600
 in this case. It's gonna be proc slash CPU info.

189
00:09:16.900 --> 00:09:19.200
And so here we can see we print out the

190
00:09:19.200 --> 00:09:22.300
 contents of the CPU and file and it

191
00:09:22.300 --> 00:09:25.300
 basically it just the metadata around the CPU using

192
00:09:25.300 --> 00:09:28.500
 you can see here that we're using an Intel Xeon. It is

193
00:09:28.500 --> 00:09:31.500
 2 point, you know, 2300 megahertz

194
00:09:31.500 --> 00:09:34.300
 and processes zero which basically means that

195
00:09:34.300 --> 00:09:37.200
 this is only one core. If there was two cores you

196
00:09:37.200 --> 00:09:40.200
 would see multiple entries of the same thing and the next

197
00:09:40.200 --> 00:09:41.200
 one be processor one.

198
00:09:41.800 --> 00:09:44.300
Okay, so let's get out of the proc file system.

199
00:09:44.300 --> 00:09:46.600
 We'll go back to the root top here.

200
00:09:47.400 --> 00:09:50.500
The next director we're going to talk about is home. So home is

201
00:09:50.500 --> 00:09:53.300
 basically what it sounds like. It's where all the users home directories are

202
00:09:53.300 --> 00:09:55.500
 kept. So we're gonna do LS.

203
00:09:56.700 --> 00:09:59.700
Home and we'll go look inside the home directory.

204
00:10:00.300 --> 00:10:03.900
So in here you see a sub directory called ec2 user

205
00:10:03.900 --> 00:10:05.000
 and this is because

206
00:10:06.100 --> 00:10:09.500
Amazon Linux default user as you recall is the ec2 user

207
00:10:09.500 --> 00:10:12.300
 and so this is just the ec2 users home directory.

208
00:10:13.700 --> 00:10:16.500
We will explore more about users directories and

209
00:10:16.500 --> 00:10:18.500
 stuff when we create users in later video.

210
00:10:19.400 --> 00:10:20.700
Okay, so let's clear the screen.

211
00:10:21.700 --> 00:10:24.400
Print the top level again since we're

212
00:10:24.400 --> 00:10:27.200
 in route. Okay, and so the next director we're going to talk about is

213
00:10:27.200 --> 00:10:28.100
 the VAR directory.

214
00:10:28.800 --> 00:10:31.400
So the vardo directory contains variable data, like

215
00:10:31.400 --> 00:10:34.600
 logs temporary files and spools. So

216
00:10:34.600 --> 00:10:37.400
 this is where you're gonna find like your male spool

217
00:10:37.400 --> 00:10:40.700
 or your system logs or application logs. So let's

218
00:10:40.700 --> 00:10:44.000
 go ahead and let's peek inside the VAR directory

219
00:10:43.100 --> 00:10:47.600
 here LS VAR and then return so

220
00:10:46.600 --> 00:10:49.500
 this other sub directories

221
00:10:49.500 --> 00:10:49.800
 in here.

222
00:10:50.600 --> 00:10:53.300
But the One You're Gonna use the most out of all these

223
00:10:53.300 --> 00:10:56.100
 is the log directory. So I'm gonna go ahead

224
00:10:56.100 --> 00:10:59.500
 and hit the up arrow and reuse my last command and we're

225
00:10:59.500 --> 00:11:03.100
 gonna go ahead and look in the VAR log sub directory.

226
00:11:03.800 --> 00:11:07.000
And so as you can see in here, we have a

227
00:11:06.200 --> 00:11:09.300
 whole bunch of other logs and you can

228
00:11:09.300 --> 00:11:12.500
 see one messages mail log. There's

229
00:11:12.500 --> 00:11:15.600
 the cron log from the cron Damon running. And

230
00:11:15.600 --> 00:11:18.200
 so if you are troubleshooting or

231
00:11:18.200 --> 00:11:21.300
 you need to find a log, this is probably one of the first places

232
00:11:21.300 --> 00:11:21.900
 you go look,

233
00:11:23.200 --> 00:11:26.800
So let me go ahead and we'll close this out. I will clear the

234
00:11:26.800 --> 00:11:27.000
 screen.

235
00:11:28.200 --> 00:11:31.100
Print the top hierarchy again. And so this is

236
00:11:31.100 --> 00:11:34.600
 the last director we're gonna talk about and this is the Libra so the

237
00:11:34.600 --> 00:11:37.400
 lib directory contains any Library needed to boot the system

238
00:11:37.400 --> 00:11:38.500
 and help binaries.

239
00:11:39.500 --> 00:11:42.600
That are located in the bin and Espin director that we saw earlier.

240
00:11:42.600 --> 00:11:45.100
 So let's go ahead and look at the lib directory.

241
00:11:46.200 --> 00:11:49.400
And so here is you could see there's a whole bunch

242
00:11:49.400 --> 00:11:49.800
 of other.

243
00:11:51.400 --> 00:11:54.200
Fold or directories in here as well. And so

244
00:11:54.200 --> 00:11:57.700
 these will also have libraries underneath them. But I to make

245
00:11:57.700 --> 00:12:00.600
 this probably easier to to follow let's

246
00:12:00.600 --> 00:12:03.900
 go ahead and look in the python 3.7 directory. So

247
00:12:03.900 --> 00:12:05.100
 you're gonna do LS.

248
00:12:05.900 --> 00:12:08.200
Going to do Libs / and then we're gonna

249
00:12:08.200 --> 00:12:11.400
 do python 3.7 directory. It

250
00:12:11.400 --> 00:12:14.500
 is another one another subdirectory called site packages. So

251
00:12:14.500 --> 00:12:17.400
 just go ahead and you can tab if you hit tab. It'll

252
00:12:17.400 --> 00:12:19.200
 actually complete some of these for you.

253
00:12:20.100 --> 00:12:23.700
So here I'll just show you really quick. So if I just type S and

254
00:12:23.700 --> 00:12:27.000
 then tap it out, it'll actually autocomplete for

255
00:12:26.100 --> 00:12:29.300
 me. So I don't have to click on all site packet.

256
00:12:29.300 --> 00:12:32.000
 So let's look in there and here you can see this is a

257
00:12:32.200 --> 00:12:35.400
 bunch of this other software and libraries in here that allow the

258
00:12:35.400 --> 00:12:38.600
 python3.7 binary that was in the bin

259
00:12:38.600 --> 00:12:41.100
 director. We saw earlier it allows that to run.

260
00:12:41.100 --> 00:12:44.200
 So these are like dependencies of that binary.

261
00:12:44.700 --> 00:12:46.500
Okay, so let me clear this up.

262
00:12:47.500 --> 00:12:50.700
So we talked about the file system

263
00:12:50.700 --> 00:12:51.800
 hierarchy standard.

264
00:12:52.800 --> 00:12:55.300
We went through nying of the most popular

265
00:12:55.300 --> 00:12:58.600
 directories inside your file system. So let's

266
00:12:58.600 --> 00:13:01.300
 jump back over and let's recap of what

267
00:13:01.300 --> 00:13:01.900
 we did in this video.

268
00:13:03.300 --> 00:13:04.200
Okay, so

269
00:13:05.300 --> 00:13:08.400
What we did in this video is we first we explore what

270
00:13:08.400 --> 00:13:11.200
 FHS is and how it governs in

271
00:13:11.200 --> 00:13:14.200
 in sets some standards of what directory structure and

272
00:13:14.200 --> 00:13:18.200
 files look like inside a Linux host. You also introduced

273
00:13:17.200 --> 00:13:21.100
 a commands like LS and CD that may

274
00:13:20.100 --> 00:13:23.600
 traversing the Lennox file system extremely easy.

275
00:13:23.600 --> 00:13:26.500
 Finally you explored important directories like

276
00:13:26.500 --> 00:13:29.600
 root proc Etc

277
00:13:29.600 --> 00:13:30.400
 in bin.

278
00:13:31.500 --> 00:13:34.100
In the next video, we'll go over the basics of

279
00:13:34.100 --> 00:13:37.300
 files and directories inside Linux. See you

280
00:13:37.300 --> 00:13:37.400
 soon.
