Skip to playerSkip to main contentSkip to footer
  • 2 weeks ago

Category

🤖
Tech
Transcript
00:30Hello, I got the host access, let me share my screen.
00:37So yes, we have discussed about the LS command and we even have seen all the possibilities
00:47at least most commonly used possibilities of the LS command we have used.
00:53And one thing I told, I will let you know, isn't it, that the number, maybe two, three, not
01:01three, maybe one, two, we got the, let me just share, probably copy this material, 14.
01:11So this is what we have discussed in our yesterday session.
01:16Just let me copy this and then paste here.
01:22Let me create one file and then paste here.
01:28Fine.
01:29So I am talking about this option is two, one, one, we got, did you observe one thing?
01:45When we create a text file, we got the number as one, but when we create the directory, we
01:57got the number as two.
01:59So these two, one, these are called as hard links.
02:06These are called as hard links.
02:09So there is a symbolic links and also hard links.
02:14What is hard link is, where we were created this directory.
02:22For example, let me start the EC2 instance.
02:29Yes, this is now starting.
02:31Let me connect to the EC2 instance.
02:35Our EC2 instance, Linux, 7pm EC2 instance.
02:40Let me connect.
02:42This is the today's IP address because every day, IP address definitely will change because
02:48we will start and then stop our machines, isn't it?
02:51So that is the reason, IP address will change.
02:55So let me start the machine.
02:57Yes.
02:59Now let me clear everything.
03:02And print working directory is Ubuntu.
03:06Now LSF and L.
03:08Yes.
03:09So these are what we have created here.
03:13So where are we actually?
03:18This is the logged in user.
03:21This is the logged in user.
03:23That means home slash Ubuntu is the logged in user.
03:29After Ubuntu, meaning in the directory of the Ubuntu.
03:35So we have created the files.
03:37So we have created the files like zoom.txt and then linuxnodes.txt and then these are the files
03:52we were created, isn't it?
03:57So these are called as what the hard links, hard links.
04:02For directory, always the hard link will be two.
04:07And then for the file, always the hard link will be one if you create it using the command line.
04:15That is the reason if you can see.
04:16We can see almost all hard links as one for the files that we were created through the command,
04:25maybe vi command, touch command.
04:26And for the directory, the hard link is two.
04:32Why?
04:33Because after user Ubuntu, this is directory.
04:38Inside the directory, then we can create the files.
04:41So after home, it will be at the second one and then two.
04:47After home, first is the username and then second is the directory.
04:54Whatever directory we create, for example, let me create mkdir.
05:00Let me create demo directory.
05:02Now, lsfnl, now this demo directory will also get the number two.
05:11Why?
05:11Because this is called as a hard link.
05:13Where it is?
05:15It is here, which is after home.
05:19After home, first is the Ubuntu user.
05:24Second is the directory name.
05:26So where exactly it is after the logged in user is represented with this hard links.
05:35Got it?
05:36So this is what I told yesterday.
05:38I will check and then leave.
05:41And this is what the content yesterday I told me.
05:45This is what yesterday I told.
05:46I will check and then let you know.
05:47Isn't it?
05:48So this is called hard links actually.
05:51So let me update the notes.
05:54And then let me even.
05:55Sir, I have one now.
05:57Yeah, go ahead, please.
05:58Sir, for the files, the hard link is denoted as one, correct?
06:04Correct.
06:04Correct.
06:05Okay.
06:05And the directories hard link denoted by two, correct, sir?
06:10Correct.
06:11Correct.
06:11But, sir, suppose if we create any directory inside slash, not inside home, sir, so that
06:19hard link number is two or it will change?
06:22If it is, uh, hello, I've also seen somewhere that, uh, there's also a three value.
06:41So what does this, the three denotes, I think, sir, I have some internet issue.
06:58Okay.
07:21Okay.
11:22Just right click on my name and then give me the host access.
11:26Yeah, yeah, sir.
11:26I'm doing that.
11:28Thank you so much.
11:38Thank you so much.
11:40I'm just sharing my screen.
11:42I'm just sharing my screen.
11:43Yes.
11:44I hope you are able to see my screen now.
11:47Yes, sir.
11:48Yes.
11:48Yes.
11:49So I'm clearing everything and then print working directory.
11:55So now we are in the home slash ubuntu.
11:58So now we are in the home slash ubuntu.
12:01Yes, we are here now.
12:03Right.
12:04So now what I'm saying is whatever the directory we created for this directory, we are getting
12:11this hardlink as two and then someone have asked me the question like if we change it to the main
12:19directory or parent directory, then in the parent directory, if we create any directory, then what
12:28is the number that we will get obviously two because one is a parent directory and then second one is the
12:35directory that we get we're going to create.
12:37So mkdir and then let us create demo.
12:43Now, of course, the sudo user mkdir, what is sudo and all I'll explain now ls-l, see this demo user.
12:56What is the link that the demo user got to why?
12:59Because again, one is the root directory and inside the root directory, there is a all these
13:06directories like demo directory, but you can see all the directories are not having
13:11the two only like boot directory have the number three.
13:16And then the dev directory have the number 17, etc have number 95.
13:22So those are the symbolic links also.
13:29So there is a concept called symbolic link versus the hard link.
13:35So symbolic link meaning, many, many links, for example, if we go to the ETC directory and
13:45ls-l if you can see, there were many directories it is referring to.
13:52See this local time is again referring to another directory.
13:57And likewise, we can see this result.cynf is referring to another directory.
14:06And RMT is referring to another directory.
14:09So these are called soft links.
14:11Similarly, there will be hard links as well.
14:15For example, see this every directory by default when created is coming with the number two because
14:21it will be obviously under one directory under one parent directory or under one root directory.
14:31So that is the reason root meaning here, what I mean to say is this is the parent directory
14:36or under any other directory.
14:37So a directory is creating under any other directory.
14:40So by default, number two will be allocated to it.
14:44But other than number two, number four, number 17, number 95, that is also called as a symbolic
14:52links.
14:53I will explain about the symbolic links versus hard links later in time, maybe not right now.
14:58It is not the right time to discuss, maybe later in time, I'll discuss, but in our class.
15:05But sir, if the supposed number is 95, so that number, hard link number is the system generated
15:12or what, sir?
15:14Operating system generated based on the directories that it have, for example, ETC is showing 95.
15:22If you can see, go here, ETC showing 95, 95 meaning it have these many directories inside
15:29in it, if you can see, right?
15:32So these many directories inside in it, again, each and every directory may have contains the
15:37other things inside that, right?
15:40For example, we are in the ETC.
15:42So just let me execute one command later in time.
15:49Let me execute sudo du-sh dot.
15:57And by total memory taken is 5.3 MB.
16:04So, but if you can see the original size, it is taking 50 to 15 KB, 4096 KB.
16:10What does it mean?
16:11ETC itself is taking just this 5.3 MB.
16:17But internally, it contains the other directories as well.
16:20Again, the directory contains one more directory.
16:23Likewise, the aggregated, all the directories that the ETC have is the 95.
16:28Okay.
16:29So, but the number is the special meaning or what, sir?
16:34We have not still understand.
16:36The number is different.
16:38So, is the meaning?
16:41Okay.
16:42Yes.
16:43Yes.
16:44There is a meaning.
16:45For example, demo we have created.
16:47What is the number for the demo 2?
16:51Inside the demo, we don't have anything and then demo is in the parent directory.
16:55So its level is now exactly.
16:59But if you can see here, boot is 3.
17:02So now let us go inside the boot.
17:05So cd slash cd dot dot slash boot.
17:14Now LSI 3.
17:15Again, if we can see inside the boot, there were the files, most of the files.
17:22And there is one, one and only one directory that is grub.
17:28Got it.
17:29So, so that is, that is the reason.
17:31Again, it got three and then grub location is again, four by, because it is three steps
17:38after the meaning, for example, if I go to grub, LS, if an L, sorry, PWD series boot grub
17:53is what these two, and then slash is one three.
17:57So it's a current number is four.
17:59Okay.
18:00You got my point.
18:01Right?
18:02Yes.
18:03Yes.
18:04Yes.
18:05Yes.
18:06Yes.
18:07Yes.
18:08Yes.
18:09Yes.
18:10Yes.
18:11Yes.
18:12Yes.
18:13Yes.
18:14Yes.
18:15Yes.
18:16Yes.
18:17So that is called as the number hard links, but for 95 numbers, sir, that it have all
18:28the directories, uh, so for example, here, let us say LSF and L L S F N L it is, it
18:45is having the 95, 95 meaning what is the location of ETC, ETC location is number two.
18:54And inside that there were 93 directors.
18:59So CD space for example, uh, if you are creating a new directory inside ETC, there's the number
19:05close to 96, right?
19:06Correct.
19:07Correct.
19:08These many directories who are starting with D.
19:12So this is one, two, three, four, five, six.
19:16Like that we have around 93 directories inside the ETC.
19:25Meaning it is also conclude that directory inside another directory as, for example, package
19:31kit is just a two.
19:35That means it is inside the ETC package kit don't have anything.
19:41It's number became as two network mapper number is three.
19:47And then the ACPA number is four.
19:50Maybe inside it, it have the two directives.
19:53Like that a total of the number of directives, which are inside the ETC is the hard link of
20:01the ETC.
20:04So here you can see those many number of hard links here.
20:09Got it.
20:11Any question?
20:12Uh, including the hidden, uh, directory, uh, including the hidden directories as well.
20:18Correct.
20:19Including the hidden directories.
20:20Correct.
20:21Fine.
20:22So that's about the yesterday LS command and the meaning of the LS command each and every
20:35LS command meaning.
20:36Okay.
20:37Okay.
20:38Sorry.
20:39What was that question?
20:40Could you repeat that?
20:42Actually, it was not a question.
20:43Someone unmuted.
20:44Okay.
20:45Okay.
20:46Sorry.
20:47Sorry.
20:48What was that question?
20:49Could you repeat that?
20:50Actually, it was not a question.
20:51Someone unmuted and.
20:52Okay.
20:53Okay.
20:54Sorry.
20:55Sorry.
20:56One question.
20:57I am Vijay.
20:58You are given a dot dot, uh, slash dot dot means it's term like a backward.
21:01Right?
21:02Yeah.
21:03Yeah.
21:04Yeah.
21:05Vijay.
21:06About that I will explain.
21:07First, we will see the directory structure, then how to forward and then how to come back.
21:21There is a relative path and absolute path.
21:23I will explain just to give me some time.
21:26First, let us come to this directory structure first.
21:29Very, very important directory structure.
21:32So, what is the important directories and all?
21:37We have to know.
21:38Being the DevOps engineers, we have to know.
21:41So, date, today's date is 15-06-15-June-2022.
21:51And then topic is Linux directories and files structure.
21:59We are talking about the structure.
22:02Once we understood the structure, then we will talk about the files creation and all.
22:12So, what are all the directories that have under the root directory?
22:27So, point 1.
22:28Point 1.
22:29Point 1.
22:30The directory, the directory slash is called as the parent directory or root directory.
22:44The root directory, parent directory or root directory or top level directory.
23:03Next, in Linux distribution.
23:04Next, in Linux distribution.
23:10In Linux distribution.
23:11In Linux distribution.
23:12In Linux distribution.
23:13In Linux distribution.
23:14In Linux distribution.
23:15In Linux distribution.
23:16In Linux distribution.
23:17In Linux distribution.
23:18All the directory.
23:19All the directories.
23:20All the directories.
23:21All the.
23:22directories.
23:23All the directories.
23:24will come.
23:25will create.
23:26all the directories.
23:27will create.
23:28All the directories.
23:29will create.
23:30All the directories.
23:32In Linux distribution, in Linux distribution, all the directories, all the directories will
23:53create, all the directories will, all the directories will host under this top-level
24:04directory. All the, all the other directories will host under this top-level
24:15directory. It is similar to, it is similar to C drive, C drive directory in Windows, C
24:32drive directory in Windows. Like in our Windows, when you purchase the laptop or desktop,
24:45by default, you will get with the C drive, isn't it? And later on time, in the C drive,
24:57and later on time, in the C drive, we will create many other directories, right? Who is
25:11this actually? The other guys are really chasing me. So please follow the link and all for the
25:20link and all, please follow this, our classroom folks. Okay. So please follow the link and all
25:27our classroom. People are calling me directly on my mobile and then asking for the links,
25:32which is really hard for me. However, please follow the classroom. Okay. However, it is similar
25:39to C directory in our Windows. So this is about the top-level directory, right? Now, next directory,
25:46I already have given about the directory structure in our, in our notes, in our classroom, I already
25:56have given. So the next directory that we need to study is the boot directory. So we can go here,
26:05here, there is a boot directory. So no other users can be able to log in into these directories. That
26:17is the reason I want to switch to the root user first. Now I was switched to the root user. So print
26:26working directory of the root user is slash root. Now where we are, we are in this root.
26:35Now if you want to go back to boot, then what we can do CD, we are here. One step back, we
26:50need to go. So dot, dot, dot slash, sorry, dot slash, sorry, I'm at the root directory, right?
27:05So I think I can go it one moment. So CD spade, dot, dot slash, boot, dot, dot. So dot meaning current
27:16directory, root. One more dot slash meaning come back. We are inside this root directory. Now come back
27:26from the inside the root directory, from inside the root directory, come back to the boot directory.
27:32That is a dot slash. That is given by this dot slash. And then give the boot directory name
27:38of the directory. Now we are inside the boot directory. You got it, right? If we are inside
27:45the root directory, first we need to represent the current directory. And then we represent the,
27:54inside the root directory. We need to represent the one back directory. That is a dot slash.
28:00And then boot we have to give. Okay. Now we reach to boot directory. Sir, please repeat
28:05one second. And after boot, there is a forward slash also. Then why do you put forward slash?
28:12No, we have not. After boot. Let me go back. Now print working directory. So I was in this
28:19root directory, isn't it? So this is, here I was. Correct. That means, let me connect. Yes. Go back.
28:34Go back. Go back. So I was now here in the root directory. So permission denied. But where I was,
28:42I was inside the root directory. Now, if I want to navigate to any other directories, which are
28:49equivalent to the root directory, meaning at the same level of the root directory. Now, as I already
28:56inside the root directory, I want to change the directory, mention where I am. And then where I want
29:06to go, one step back, then give boot. See, I entered B and pressing the tab. I entered B and then press the
29:17tab. Now we have the two options got bin and then boot. I entered Bevo. Now when I
29:26tab it given the forward slash here, that means what this backward slash is to from the root directory,
29:37go one step back. Now you will find the boot directory. Now go inside the boot directory is
29:44nothing but this forward slash. Now we were inside the boot directory. Got it. So PWD. Now we are inside
29:53the boot directory. That means the current directory. Again dot slash meaning one step go back. We are
30:01inside the root directory. Go one step back and go inside the root directory mean the forward slash.
30:08Now inside the boot directory. Now inside the boot directory. If we enter ls-l. So we have all the files
30:19and all which are related to the bootstrapping of our Linux file system. Linux distribution bootstrapping
30:30things were there in this boot directory. So let me go and then open our devops nodes.
30:39Let me go to the class nodes, Linux material. So Linux file system.
30:46Just let me open this. So boot contains what the bootstrapping files and then directories, especially
30:57there is a directory called grub directory. So just to scroll down. So boot, boot contains the file
31:06that is used by the kernel and bootloader. Especially there is a file called grub.cfg, which is a kernel file.
31:19That means this boot directory will be used by the kernel and then load all other directories,
31:30files, files, files, whatever the distribution related directories, files and other setup required,
31:38that it will load from the boot directory. So in the boot directory,
31:46if we can go inside the grub directory, ls-l, there is a grub.cfg. So let us chat it.
31:59Let me know whether it is the file or directory. Can anyone tell is the file or directory?
32:07It is a file. How you are saying it is a file? How you are saying?
32:10It is a hyphen symbol. Exactly. Exactly. It starts with the hyphen.
32:15Starts with the hyphen. So starts with the D meaning directory. Yes. So grub.cfg is a file.
32:23So as it is a file, to see the content of the file, we can use the command called cat. To see the content
32:33of the file, we can use the command called cat. Now grub.cfg. This is the complete file content,
32:44which is reading by the which is reading by the kernel and load the other directories information.
32:56For example, since it's a huge file, see this, begin etc.grub.d. Actually grub is inside the boot
33:07directory. But when we are cat it, it is loading from the etc. That means it has a symbolic link,
33:17soft link. I will explain about the soft link concept and all. Original file will be in one location.
33:25But when we access it, it will be accessed from the other location. So that is called the soft links.
33:31But I will explain later on time about it. I don't want to confuse it at this moment. Now see,
33:38this is the shell script, complete shell script, load environment. And then if we can see,
33:48in order to load the environment, load video, then all video,
33:57input console, terminal input console, and then the all the all the files, all the loader files,
34:08just to bootstrap the Linux distribution, all the loader files will be loaded from this boot directory,
34:16especially from this grub.cfg file. Got it? It is a your kernel level operating system configuration file.
34:31So that is the boot directory. So boot directory contains all the all the environment specific or
34:40environment. Boot, while bootstrapping the distribution, whatever the environment files,
34:47directories need to be loaded. Those are all we'll pick from here. Got it? So that is about the boot
34:57directory. Where we don't touch this directory. In your day-to-day work, you don't touch this directory.
35:05You should not touch this directory. Now let us go to the again here. So boot directory we understood.
35:16Now let us go to the next directory. We never touched this boot directory. We no need to worry about it.
35:24Next directory is the root directory. So root directory is said to be a root user's directory.
35:36Like a slash home is said to be a non-root users directory. In any Linux distribution,
35:45we will have two kind of users. One is the root user. That means administrator user. That means super admin user.
35:57And another one is the non-root user. And another one is the non-root user. Who is this simple user,
36:01non-user. He is a non-admin, non-root, non-super. Just a normal user he is.
36:08So normal users will be inside the home directory. And per operating system distribution, there will be
36:17only one user, super user called the root user. So there will be one root user directory.
36:28Whereas many users directories will be created under this home directory. By default, we can see the home
36:40directory with the user called Ubuntu. If we create one more user and that user also will be created
36:49inside the home directory. Like John. And then one more directory may be like Kane, Peter. No matter
36:59how many directories you will create, how many users you will create, for all those users,
37:06the directory will be created under the home. Now go back. Now you got understand. Home is the
37:23non-users directory. Root is the root user directory. So two users we have. One is the root user.
37:33Second one is the non-root user. So that is what I was mentioned here. What is the root? With the root,
37:42there are three types of root available in our Linux mission. One is the root account or root user.
37:52So on Linux mission, we have a username called root, which is also called as an account. Most powerful
37:59account which has access to all commands and files. Then there is a root directory, but not root users
38:08directory. Please, please, please make sure the clear difference between the root directory and then
38:16root users directory. Root users directory is slash root. Root directory is slash. There is a lot of
38:27difference difference. Please, please identify this difference. So root as a slash, the very first
38:36directory in Linux is also referred as the root directory. And there is a root home directory.
38:45The root user account also has a directory located in slash root, which is called as a root home directory.
38:54Like non-root. Like non-root users are in the slash home directory. Similarly, the root user will also be
39:02in the directory called slash root. So every Linux operating system will come up with one administrator
39:11user called root. And whose directory is the slash root. Got it? Now, there are two users we understood.
39:27One is the root user. Second one is the non-root user. So to switch from root user to non-root user,
39:35root user to root user, what is the pseudo, I will explain in the coming up sessions. But let us go back to
39:45again our discussion of the Linux directory structure. So root meaning root user home directory.
39:55It is not same as a slash. It is not same as a slash. And remember carefully, please, when we go to Kubernetes,
40:07let me go to this pwd. Let us go to root directory. See this? Where I am now? I am at the root directory.
40:16So in order to go to other directory from the root directory, I was not mentioning slash. I was just
40:22mentioning this root. Now we've entered to the root directory. Remember, in our Kubernetes,
40:33we will create the certificates,
40:36and all we will create in this root user directory. So that the directories are the files, what we will
40:54create security files, we will create like private key signature file and all we will create. Those files
41:04have the complete access on the root user where those will be used by our Kubernetes nodes as well. I'm just
41:14giving you a heads up, the usage of the root directory, how and where we will use in our going forward.
41:22The files directories inside this root directory are completely accessed by the root user.
41:29However, whoever has been logged in that username will come here. But the accessibility of it will be
41:37completely given to the root user. So in our Linux directory structure, slash root meaning the root
41:48users home directory, it is not same as slash parent directory.
41:54And there is one more directory called dev. So go here. There is one more directory called dev.
42:06So let us go inside the dev directory. Now where I am, I am inside the root directory. So what I have to do,
42:14mention current directory. Hello, sir. Yes. So about the root directory.
42:19So every user has a root directory access or no, no, no, no, only root user have the root directory access.
42:32Every user that we gonna create have the by default access in his directory only. That means,
42:40let's say, let's say, let us create one user called kane. This time creating later and time,
42:48I will tell you how I have created and all later and time will discuss. But for now, I'm just creating a default user,
42:55just a dummy user I'm creating. Now, if you can refresh, kane is one user here. Right? So meaning,
43:06now the kane is user have the permissions on the only the user's directory, kane user directory.
43:16He don't have the permission on other directories like dev directory, boot directory, root directory. No,
43:22he don't have the permission. He have the only permission in the directory, meaning with the directory
43:30on which his name is created. Got it, huh? Clear? So root user have the access, the files, the directories
43:40inside the root user will be only accessed by the root user only. Got it? Clear? Yes, sir. Thank you.
43:51Perfect. Perfect. Now, we are still in the root user. Now, let us go to the next directory called dev.
44:02Next directory called dev. Now, I'm in the root directory. I'm inside this root directory. Now,
44:11can anyone tell me how I can go back to the boot directory or dev directory?
44:18That is the current directory. Then one more. Exactly. Correct. Now, the name of the directory.
44:24My bad folks. Again, my mission is struck. It seems to be audible. Yes. Yes. Yes. Yes. Okay. Okay.
44:36Seems to be my mission is struck, but I am audible. Just to give you an element. Actually, I was given,
44:43I'm about to give this mission for the repair. So I'm traveling tonight for my, for Hyderabad to hand over
44:48this mission in the office. Hopefully, from tomorrow onwards, I maybe take your classes on the new mission.
44:54No kind of struckings will be happened, I believe. But now it's stuck. So I'm not able to move the cursor.
45:03Let me check.
45:23Let me check.
45:40Also, using this CD, double. Come on. You are going one directory back now.
45:49Yes, it is for one directory only.
46:02Sir told Shubham that first dot is for you are in present directory, whether dot and
46:09there is a link in the description of the description of the description of the description.
47:29I hope till now the telegram group has not created for us, right?
47:39Actually, it has created only two of them has joined.
47:46So can anyone share that?
47:49No, no.
47:51Sar said he will suggest the backend team to do it.
47:55Can you share the group link, telegram group link?
48:07Okay, can you share the group link, telegram group link?
51:24Thanks.
51:36you
51:39guys I have shared the curriculum
51:42you
51:45you
51:48you
51:51you
51:54you
51:57you
52:00you
52:02you
52:06you
52:09you
52:11you
52:13you
52:27you
52:31you
55:08Thank you guys.
55:11Bye.
55:12I think we can drop off.
55:19Thank you guys.
55:20Bye.
55:22Okay.
55:24Bye.
55:25Bye.
55:28Bye.
55:29Bye.
Be the first to comment
Add your comment

Recommended

59:09
Up next
1:02:30
1:02:58
58:55
5:18
1:07