linux how to check existence of a group
/ bash / egrep / GNU/Linux / group / howtos / user. You can find out if user exists by searching in the /etc/passwd file using the following command: egrep -i ^useraccount: /etc/passwd. The above command will print the matching record from /etc/passwd if the user exists or nothing if the user does not exist.