-2

Want to create multiple user in Linux, but first need to check user already exists or not,if not exist the user get created.

  • Yes, there is. What have you tried? – tink Oct 13 '20 at 04:21
  • 1
    Some Linux distributions have `adduser` or `useradd` commands. See eg [useradd(8)](https://man7.org/linux/man-pages/man8/useradd.8.html) and [passwd(5)](https://man7.org/linux/man-pages/man5/passwd.5.html) – Basile Starynkevitch Oct 13 '20 at 04:22
  • And, more importantly, which information about those users do you have, and in in what form is it presented? – tink Oct 13 '20 at 04:47
  • If not a duplicate, this question already have many answer! Try `man adduser` in a console, in your system, and have look at https://superuser.com/questions/547966/whats-the-difference-between-adduser-and-useradd – F. Hauri - Give Up GitHub Oct 13 '20 at 07:19
  • Does this answer your question? [What's the difference between "adduser" and "useradd"?](https://superuser.com/questions/547966/whats-the-difference-between-adduser-and-useradd) – karel Oct 14 '20 at 02:17

1 Answers1

1

Take a look at this:

https://linux.die.net/man/8/newusers

It will allow you to create new users in batch from a file.

  • The command to add a new user is distribution dependent and also the question states how does the Masoom check if a user exists before creating. This partly answers the question. – fswings Oct 22 '20 at 20:20