is a command to create a user account named serena, including a home directory and a description. 1

is a command to create a user account named serena, including a home directory and a description.

[root@RHEL5 ~]# useradd -m -d /home/yanina -c "yanina wickmayer" yanina
[root@RHEL5 ~]# tail -1 /etc/passwd
yanina:x:529:529:yanina wickmayer:/home/yanina:/bin/bash

Here is what the above code is Doing:
1. The useradd command is used to create a new user or update default new user information.
2. The -m option tells useradd to create a home directory for the new user.
3. The -d option specifies the home directory for the new user.
4. The -c option specifies the comment field for the new user.
5. The tail command is used to display the last line of the /etc/passwd file.

Similar Posts