Take the first and fourth fields (separated by a space) from the /etc/passwd file, remove all characters before the space, and sort numerically by the first field.
cut -d' ' -f1,4 /etc/passwd |sed 's/[^ ]* //' |sort -n -t, -k1,1