Hey, welcome back.
So in this lesson, we are going to learn about the home directory.
Now, as the name suggests, home, this is the home directory or the home folder for each user.
Now, for example, if you use a username or if you add a user, Rohit into a computer, you have a
home folder for that user, which is Rohit into the home directory.
So it would look something like this which is slash home, slash Rohit.
Now this home folder contains Rohit users data files or any user specific configuration files that he
makes.
Now, you should remember one very important thing that each user only has right access to their own
home folder.
That means Rohit cannot modify if there is any other user X, Y, Z, or Rohit cannot modify the root
user's home directory that is slash root.
Now to do that, he should have elevated privileges or permissions from the root user.
All right.
So we understood basically what is a home directory, which is the user's home directory.
So let's see in the practical time, what exactly create one.
All right.
So let's quickly navigate first into the home directory, which is KD slash home and hit enter and let's
see what is over here.
So there are few users into this computer as you can see admin pad, Joker, Rohit, Shifa, etc.,
which are the users that have been created and they're each specific individual home directory in which
they can work.
Now in case you want to add a new user in this system and automatically you want a home directory to
be created for that user in which they can work for that.
The command that you are going to use is user add hyphen M now hyphen M stands for to add a new home
directory if does not exist.
So let's say we are going to add a new user or let's say Hacker Pro and I'm going to hit enter and you
can see it says the user already exists, no problem.
So we are going to modify this and let's say instead of hacker, we are going to add us a pro and hit
enter and you can see it successfully added the user and let's verify if a new directory has been successfully
created or not.
And you can see there is a new home directory for the user that we created just now that was crack a.
Now this user then makes any changes or needs to do any configuration file change.
He can do that into his respective home directory, which is crack pro.
So I hope you guys understood the importance and usage of the Home Directory into the Linux file system.
Thank you.