Home > Article > Operation and Maintenance > Detailed example of how to create a user useradd command in Linux
This article uses code examples to introduce the relationship between the adduser and useradd commands and the method of using the useradd command to add users. Friends in need can refer to it
1, adduser and The relationship between the useradd command
Code example:
[root@larrywen opt]# type adduser adduser is /usr/sbin/adduser [root@larrywen opt]# type useradd useradd is /usr/sbin/useradd [root@larrywen opt]# which useradd /usr/sbin/useradd [root@larrywen opt]# which adduser /usr/sbin/adduser [root@larrywen opt]# ls -l /usr/sbin/adduser /usr/sbin/useradd lrwxrwxrwx. 1 root root 7 Jul 21 14:11 /usr/sbin/adduser -> useradd -rwxr-x---. 1 root root 97040 Feb 24 2011 /usr/sbin/useradd
2. Use useradd Command to add user
[root@larrywen /]# useradd zhink [root@larrywen /]# id zhink uid=501(zhink) gid=502(zhink) groups=502(zhink)
Summary
The above is the detailed content of Detailed example of how to create a user useradd command in Linux. For more information, please follow other related articles on the PHP Chinese website!