Check if Linux group exists using bash shell
In this example, I will use the getent command to check if a Linux group exists. if getent group "$groupname" >/dev/null; then echo "Group $groupname exists" fi Replace $groupname with the name of the group you want to check. If you like to check if the group does not exist (e.g. because you like to ... Read more