Create an account for user renay with a home directory of /home/renay, which is to be created. Use /etc/skel as the skeleton directory and /usr/bin/sh as the shell. Take the next highest UID.
# useradd -m -s /usr/bin/sh renay
Create an account for a user named Tracy. Tracy’s primary group is staff. Tracy is also in the groups pe and chemistry. Create a home directory. Take all the rest of the defaults.
# useradd -m -g staff -G pe,chemistry tracy
Display the useradd defaults.
# useradd -D
Change the default group to others.
# useradd -D -g others
To delete a user use the userdel command. The syntax is
# userdel -r login
The -r option is needed to delete the user’s home directory.
The syntax of the groupadd command is
# groupadd [-g gid [-o]]group
Example:
Add a group called economics. Use the next available group ID greater than 100.
# groupadd economics