User-friendly command to list all users on Ubuntu system

command lineusers

Is there a user-friendly command I can use to list users in a console on an Ubuntu system?

When I cat /etc/passwd I get a hard-to-read list of users. It would be nice to see an alphabetized list, with entries arranged into columns, and with group names in parentheses beside the group IDs.

Best Answer

Good way for nice output of /etc/passwd file:

$ column -nts: /etc/passwd

Now you can sort it:

$ column -nts: /etc/passwd | sort

With groups names in last column (no parenthesis):

$ paste -d: /etc/passwd <(groups $(cut -d: -f1 /etc/passwd) | sed 's/.*: //') | column -nts: | sort
Related Question