How To List All Users In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Use the getent command
To list all users on a Linux system, you can use the getent command with the passwd option. The output will contain a list of all users on the system, including system and normal users.
Example:
$ getent passwd
2. Use the cat command
You can also use the cat command to view the content of the /etc/passwd file. This file contains a list of all users registered on the system.
Example:
$ cat /etc/passwd