lslogins Command Examples in Linux

lslogins is a Linux command that provides information about the users on a system. It displays a list of users along with details such as the user ID (UID), group ID (GID), real name (GECOS), home directory, and shell. This information is gathered from various sources such as /etc/passwd, /etc/group, and other system-specific user information databases.

The output of lslogins can be useful in various scenarios, such as when you need to identify a specific user on the system, check the details of a user account, or get an overview of all the users on the system. The command can be used with different options to customize the information displayed and filter the output based on specific criteria.

lslogins Command Examples

1. Display users in the system:

# lslogins

2. Display users belonging to a specific group:

# lslogins --groups=groups

3. Display user accounts:

# lslogins --user-accs

4. Display last logins:

# lslogins --last

5. Display system accounts:

# lslogins --system-accs

6. Display supplementary groups:

# lslogins --supp-groups
Related Post