GID creation is already exists

I have given the correct command for creating the GID, but I am not getting the correct answer. The GID already exists


https://learn.kodekloud.com/user/courses/learning-linux-basics-course-labs/module/6c7e1a9b-9ecc-43c5-9dce-8031ab5d3fe2/lesson/d441ffb6-31e6-4194-abbc-3875324cecea.

Hi @bhanuprakashk

You might have created the same john group with a different gid.
It worked for me with the same commands:
sudo groupadd -g 1010 john
sudo useradd -u 1010 -g 1010 -s /bin/sh john

The issue is, that the very first command you used: sudo useradd john already created a group of the same name, as the provided user name (but very likely not with an intended GID number).