>_ IzzyLab

Topic breakdown

Groups in Linux are described in the text file /etc/group: one line per group, with fields separated by colons — the name, a password placeholder, the numeric GID and a comma-separated member list. Columnar data like this is easy to split by delimiter: you specify the delimiter character and the field number, and only the column you need is left from each line. The result goes to a file with the > redirection.

What's checked

  1. root and sudo groups in the list
  2. the list has only names
  3. line count matches /etc/group

What it looks like