| Linux CLI: List Users and Groups |
|
|
|
| Tech Notes - Linux |
| Written by Rick |
| Tuesday, 26 August 2008 00:00 |
|
At times it's necessary to get a list of users and groups on a Linux system from the command line interface (CLI). The files containing the information are located in your /etc directory. passwd - This file stores the users and passwords for the subject system. (Note: Ubuntu uses Shadow passwords. The actual encrypted password is stored in /etc/shadow. In the /etc/passwd file, the encrypted password has been replaced by an "x".) group - This file stores the user groups and group passwords. (Note: Shadow passwords apply here too. The file containing the group passwords is /etc/gshadow). To display the content of the above files, use the "cat" command (i.e.; cat /etc/passwd). |




