How to create home directory while creating user in Linux

We can use the useradd command to create new users in Linux. But this will not create the home directory by default.

Inorder to create home directory while creating user, we need to use the "-m" option along with the command.

#useradd -m -d homedir user

Where homedir and user need to be replaced with full path to home directory and username respectively.

That's all…