Get a List of All Users

Local user information is stored in the /etc/passwd file. Each line in this file represents login information for one user. To view file:

less /etc/passwd

If you want to display only the username you can use either awk or cut commands to print only the first field containing the username:

awk -F: '{ print $1}' /etc/passwd
cut -d: -f1 /etc/passwd

Leave a Reply

Your email address will not be published. Required fields are marked *