Split the /etc/passwd file by semicolons and select the 3rd and 4th fields, sort the output by the 3rd field numerically, and print the first and second fields for any line where the second field is not equal to "x".
cut -d\; -f3,4 /etc/passwd | sort -t: -k3 -n | awk -F":" '$2!="x"{print $1,$2}'