>_ IzzyLab

Topic breakdown

/etc/passwd is a text database of accounts: one line per user, fields separated by : in the order name:password:UID:GID:GECOS:home:shell. cut cuts out columns: -d sets the delimiter, -f the field numbers (-f3 — the third, -f1,3 — the first and third). For columns with fixed meaning this is the most direct way to get a value.

What's checked

  1. UID matches the real one
  2. file contains only a number

What it looks like