lslogins: command not found

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.

If you encounter the below error while running the command lslogins:

lslogins: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install util-linux

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