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 XY said or Rohit
cannot modify the root user's home directory that
is slash route now to do
That he should have elevated privileges or
permissions from the root user. Alright, 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 exam we
create one.
All right. So let's quickly navigate first into
the home directory, which is CD 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 bad 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 -
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 as cracker 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 cracker Pro
now this user when makes
any changes or needs to do any configuration
file change. He can do that into his
respective home directory, which is Cracker Pro.
So, I hope you guys understood the importance and
usage of the home directory into
the Linux file system. Thank you.