>_ IzzyLab

Topic breakdown

/etc/passwd is a table with colon-separated fields: name, UID, GID, shell and so on. For awk to see these fields, the separator is switched to a colon (the -F flag or the FS variable), after which the right columns are accessed by number. Filtering by exact string equality selects the wanted records, and since you need to sort by the numeric UID but output the name, it's convenient to output a key-value pair, sort it numerically with sort, and then keep only the name.

What's checked

  1. all users with shell /bin/bash are included
  2. the nologin user is excluded
  3. sorted by ascending UID

What it looks like