1 .\" Copyright 2014 Ondrej Oprala (ondrej.oprala@gmail.com)
2 .\" May be distributed under the GNU General Public License
3 .TH LSLOGINS "1" "April 2014" "util-linux" "User Commands"
5 lslogins \- display information about known users in the system
9 .RB [ \-s | \-u [ =\fIUID ]]
10 .RB [ \-g " \fIgroups\fR]"
11 .RB [ \-l " \fIlogins\fR]"
15 Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd
16 and output the desired data.
18 The optional argument \fIusername\fR forces
20 to print all available details about the specified user only. In this case the
21 output format is different than in case of \fB\-l\fR or \fB\-g\fR and unknown
22 is \fIusername\fR reported as an error.
25 The default action is to list info about all the users in the system.
27 Mandatory arguments to long options are mandatory for short options too.
29 \fB\-a\fR, \fB\-\-acc\-expiration\fR
30 Display data about the date of last password change and the account expiration
31 date (see \fBshadow\fR(5) for more info). (Requires root privileges.)
33 \fB\-\-btmp\-file \fIpath\fP
34 Alternate path for btmp.
36 \fB\-c\fR, \fB\-\-colon\-separate\fR
37 Separate info about each user with a colon instead of a newline.
39 \fB\-e\fR, \fB\-\-export\fR
40 Output data in the format of NAME=VALUE.
42 \fB\-f\fR, \fB\-\-failed\fR
43 Display data about the users' last failed login attempts.
45 \fB\-G\fR, \fB\-\-supp\-groups\fR
46 Show information about supplementary groups.
48 \fB\-g\fR, \fB\-\-groups\fR=\fIgroups\fR
49 Only show data of users belonging to \fIgroups\fR. More than one group
50 may be specified; the list has to be comma-separated. The unknown group
53 Note that relation between user and group may be invisible for primary group if
54 the user is not explicitly specify as group member (e.g. in /etc/group). If the
55 command lslogins scans for groups than it uses groups database only, and user
56 database with primary GID is not used at all.
58 \fB\-h\fR, \fB\-\-help\fR
59 Display help information and exit.
61 \fB\-L\fR, \fB\-\-last\fR
62 Display data containing information about the users' last login sessions.
64 \fB\-l\fR, \fB\-\-logins\fR=\fIlogins\fR
65 Only show data of users with a login specified in \fIlogins\fR (user names or user
66 IDS). More than one login may be specified; the list has to be comma-separated.
67 The unknown login names are ignored.
69 \fB\-n\fR, \fB\-\-newline\fR
70 Display each piece of information on a separate line.
73 Do not print a header line.
76 Don't truncate output.
78 \fB\-o\fR, \fB\-\-output \fIlist\fP
79 Specify which output columns to print.
80 The default list of columns may be extended if \fIlist\fP is
81 specified in the format \fI+list\fP.
84 Output all available columns.
86 to get a list of all supported columns.
88 \fB\-p\fR, \fB\-\-pwd\fR
89 Display information related to login by password (see also \fB\-afL).
91 \fB\-r\fR, \fB\-\-raw\fR
92 Raw output (no columnation).
94 \fB\-s\fR, \fB\-\-system\-accs\fR
95 Show system accounts. These are by default all accounts with a UID between 101 and 999
96 (inclusive), with the exception of either nobody or nfsnobody (UID 65534).
97 This hardcoded default may be overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in
98 the file /etc/login.defs.
100 \fB\-\-time\-format\fR \fItype\fP
101 Display dates in short, full or iso format. The default is short, this time
102 format is designed to be space efficient and human readable.
104 \fB\-u\fR, \fB\-\-user\-accs\fR
105 Show user accounts. These are by default all accounts with UID above 1000
106 (inclusive), with the exception of either nobody or nfsnobody (UID 65534).
107 This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in
108 the file /etc/login.defs.
110 \fB\-V\fR, \fB\-\-version\fR
111 Display version information and exit.
113 \fB\-\-wtmp\-file \fIpath\fP
114 Alternate path for wtmp.
116 \fB\-Z\fR, \fB\-\-context\fR
117 Display the users' security context.
119 \fB\-z\fR, \fB\-\-print0\fR
120 Delimit user entries with a nul character, instead of a newline.
123 The default UID thresholds are read from /etc/login.defs.
131 if incorrect arguments specified,
134 if a serious error occurs (e.g. a corrupt log).
136 \fBgroup\fP(5), \fBpasswd\fP(5), \fBshadow\fP(5), \fButmp\fP(5)
138 The \fBlslogins\fP utility is inspired by the \fBlogins\fP utility, which first appeared in FreeBSD 4.10.
140 .MT ooprala@redhat.com
149 The lslogins command is part of the util-linux package and is available from
150 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/