sort -t: -k3 -n /etc/passwd

Category: Text Processing

sort -t: -k3 -n /etc/passwd

Sort passwd file by UID (3rd colon-separated field)

Sorts the /etc/passwd file numerically by the third colon-separated field (which is the user ID number). -t: sets colon as separator.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.