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]"
14 Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd
15 and output the desired data.
17 The default action is to list info about all the users in the system.
19 Mandatory arguments to long options are mandatory for short options too.
21 \fB\-a\fR, \fB\-\-acc\-expiration\fR
22 Display data about the date of last password change and the account expiration
23 date (see \fBshadow\fR(5) for more info). (Requires root privileges.)
25 \fB\-\-btmp\-file \fIpath\fP
26 Alternate path for btmp.
28 \fB\-c\fR, \fB\-\-colon\-separate\fR
29 Separate info about each user with a colon instead of a newline.
31 \fB\-e\fR, \fB\-\-export\fR
32 Output data in the format of NAME=VALUE.
34 \fB\-f\fR, \fB\-\-failed\fR
35 Display data about the users' last failed login attempts.
37 \fB\-G\fR, \fB\-\-supp\-groups\fR
38 Show information about groups.
40 \fB\-g\fR, \fB\-\-groups\fR=\fIgroups\fR
41 Only show data of users belonging to \fIgroups\fR. More than one group
42 may be specified; the list has to be comma-separated.
44 \fB\-h\fR, \fB\-\-help\fR
45 Display help information and exit.
47 \fB\-L\fR, \fB\-\-last\fR
48 Display data containing information about the users' last login sessions.
50 \fB\-l\fR, \fB\-\-logins\fR=\fIlogins\fR
51 Only show data of users with a login specified in \fIlogins\fR (user names or user
52 IDS). More than one login may be specified; the list has to be comma-separated.
54 \fB\-n\fR, \fB\-\-newline\fR
55 Display each piece of information on a separate line.
58 Do not print a header line.
61 Don't truncate output.
63 \fB\-o\fR, \fB\-\-output \fIlist\fP
64 Specify which output columns to print. Use
66 to get a list of all supported columns.
68 \fB\-p\fR, \fB\-\-pwd\fR
69 Display information related to login by password (see also \fB\-afL).
71 \fB\-r\fR, \fB\-\-raw\fR
72 Raw output (no columnation).
74 \fB\-s\fR, \fB\-\-system\-accs\fR
75 Show system accounts. These are by default all accounts with a UID below 1000
76 (non-inclusive), with the exception of either nobody or nfsnobody (UID 65534).
77 This hardcoded default maybe overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in
78 the file /etc/login.defs.
80 \fB\-\-time\-format\fR \fItype\fP
81 Display dates in short, full or iso format. The default is short, this time
82 format is designed to be space efficient and human readable.
84 \fB\-u\fR, \fB\-\-user\-accs\fR
85 Show user accounts. These are by default all accounts with UID above 1000
86 (inclusive), with the exception of either nobody or nfsnobody (UID 65534).
87 This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in
88 the file /etc/login.defs.
90 \fB\-V\fR, \fB\-\-version\fR
91 Display version information and exit.
93 \fB\-\-wtmp\-file \fIpath\fP
94 Alternate path for wtmp.
96 \fB\-Z\fR, \fB\-\-context\fR
97 Display the users' security context.
99 \fB\-z\fR, \fB\-\-print0\fR
100 Delimit user entries with a nul character, instead of a newline.
103 The default UID thresholds are read from /etc/login.defs.
111 if incorrect arguments specified,
114 if a serious error occurs (e.g. a corrupt log).
116 \fBgroup\fP(5), \fBpasswd\fP(5), \fBshadow\fP(5), \fButmp\fP(5)
118 The \fBlslogins\fP utility is inspired by the \fBlogins\fP utility, which first appeared in FreeBSD 4.10.
120 .MT ooprala@redhat.com
129 The lslogins command is part of the util-linux package and is available from
130 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/