The useradd command

create a new user or update default new user information 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-m, --create-home
Create the user's home directory if it does not exist.
-s, --shell SHELL
sets the path to the user's login shell.
-c, --comment COMMENT
Any text string. It is generally a short description of the account, and is currently used as the field for the user's full name.

Examples

sudo useradd username
sudo useradd -m -s /bin/bash -c "Full Name" username
useradd -m -s /bin/bash NAME

Account, home folder (-m), shell (-s)

sudo useradd -m ana

Create account with home directory

Lessons that use useradd