Linux "lslogins" Command Line Options and Examples
display information about known users in the system

Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd and output the desired data. The default action is to list info about all the users in the system..


Usage:

lslogins [options] [-s|-u[=UID]] [-g groups] [-l logins]






Command Line Options:

-a
Display data about the date of last password change and the account expiration date (see shadow(5) for more info). (Requiresroot privileges.)
lslogins -a ...
--btmp-file
Alternate path for btmp.
lslogins --btmp-file ...
-c
Separate info about each user with a colon instead of a newline.
lslogins -c ...
-e
Output data in the format of NAME=VALUE.
lslogins -e ...
-f
Display data about the users' last failed login attempts.
lslogins -f ...
-G
Show information about supplementary groups.
lslogins -G ...
-g
Only show data of users belonging to groups. More than one group may be specified; the list has to be comma-separated.Note that relation between user and group may be invisible for primary group if the user is not explicitly specify as groupmember (e.g. in /etc/group). If the command lslogins scans for groups than it uses groups database only, and user databasewith primary GID is not used at all.
lslogins -g ...
-h
Display help information and exit.
lslogins -h ...
-L
Display data containing information about the users' last login sessions.
lslogins -L ...
-l
Only show data of users with a login specified in logins (user names or user IDS). More than one login may be specified; thelist has to be comma-separated.
lslogins -l ...
-n
Display each piece of information on a separate line.
lslogins -n ...
--noheadings
Do not print a header line.
lslogins --noheadings ...
--notruncate
Don't truncate output.
lslogins --notruncate ...
-o
Specify which output columns to print. Use --help to get a list of all supported columns.
lslogins -o ...
-p
Display information related to login by password (see also -afL).
lslogins -p ...
-r
Raw output (no columnation).
lslogins -r ...
-s
Show system accounts. These are by default all accounts with a UID below 1000 (non-inclusive), with the exception of eithernobody or nfsnobody (UID 65534). This hardcoded default maybe overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in thefile /etc/login.defs.
lslogins -s ...
--time-format
Display dates in short, full or iso format. The default is short, this time format is designed to be space efficient andhuman readable.
lslogins --time-format ...
-u
Show user accounts. These are by default all accounts with UID above 1000 (inclusive), with the exception of either nobody ornfsnobody (UID 65534). This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in the file/etc/login.defs.
lslogins -u ...
-V
Display version information and exit.
lslogins -V ...
--wtmp-file
Alternate path for wtmp.
lslogins --wtmp-file ...
-Z
Display the users' security context.
lslogins -Z ...
-z
Delimit user entries with a nul character, instead of a newline.NOTESThe default UID thresholds are read from /etc/login.defs.EXIT STATUS0 if OK,1 if incorrect arguments specified,2 if a serious error occurs (e.g. a corrupt log).
lslogins -z ...