1LSLOGINS(1) User Commands LSLOGINS(1)
2
3
4
6 lslogins - display information about known users in the system
7
9 lslogins [options] [-s|-u[=UID]] [-g groups] [-l logins]
10
12 Examine the wtmp and btmp logs, /etc/shadow (if necessary) and
13 /etc/passwd and output the desired data.
14
15 The default action is to list info about all the users in the system.
16
18 Mandatory arguments to long options are mandatory for short options
19 too.
20
21 -a, --acc-expiration
22 Display data about the date of last password change and the
23 account expiration date (see shadow(5) for more info).
24 (Requires root privileges.)
25
26 --btmp-file path
27 Alternate path for btmp.
28
29 -c, --colon-separate
30 Separate info about each user with a colon instead of a newline.
31
32 -e, --export
33 Output data in the format of NAME=VALUE.
34
35 -f, --failed
36 Display data about the users' last failed login attempts.
37
38 -G, --supp-groups
39 Show information about supplementary groups.
40
41 -g, --groups=groups
42 Only show data of users belonging to groups. More than one
43 group may be specified; the list has to be comma-separated.
44
45 Note that relation between user and group may be invisible for
46 primary group if the user is not explicitly specify as group
47 member (e.g. in /etc/group). If the command lslogins scans for
48 groups than it uses groups database only, and user database with
49 primary GID is not used at all.
50
51 -h, --help
52 Display help information and exit.
53
54 -L, --last
55 Display data containing information about the users' last login
56 sessions.
57
58 -l, --logins=logins
59 Only show data of users with a login specified in logins (user
60 names or user IDS). More than one login may be specified; the
61 list has to be comma-separated.
62
63 -n, --newline
64 Display each piece of information on a separate line.
65
66 --noheadings
67 Do not print a header line.
68
69 --notruncate
70 Don't truncate output.
71
72 -o, --output list
73 Specify which output columns to print. Use --help to get a list
74 of all supported columns.
75
76 -p, --pwd
77 Display information related to login by password (see also
78 -afL).
79
80 -r, --raw
81 Raw output (no columnation).
82
83 -s, --system-accs
84 Show system accounts. These are by default all accounts with a
85 UID below 1000 (non-inclusive), with the exception of either
86 nobody or nfsnobody (UID 65534). This hardcoded default maybe
87 overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in the
88 file /etc/login.defs.
89
90 --time-format type
91 Display dates in short, full or iso format. The default is
92 short, this time format is designed to be space efficient and
93 human readable.
94
95 -u, --user-accs
96 Show user accounts. These are by default all accounts with UID
97 above 1000 (inclusive), with the exception of either nobody or
98 nfsnobody (UID 65534). This hardcoded default maybe overwritten
99 by parameters UID_MIN and UID_MAX in the file /etc/login.defs.
100
101 -V, --version
102 Display version information and exit.
103
104 --wtmp-file path
105 Alternate path for wtmp.
106
107 -Z, --context
108 Display the users' security context.
109
110 -z, --print0
111 Delimit user entries with a nul character, instead of a newline.
112
113
115 The default UID thresholds are read from /etc/login.defs.
116
117
119 0 if OK,
120
121 1 if incorrect arguments specified,
122
123 2 if a serious error occurs (e.g. a corrupt log).
124
126 group(5), passwd(5), shadow(5), utmp(5)
127
129 The lslogins utility is inspired by the logins utility, which first
130 appeared in FreeBSD 4.10.
131
133 Ondrej Oprala ⟨ooprala@redhat.com⟩
134 Karel Zak ⟨kzak@redhat.com⟩
135
136
138 The lslogins command is part of the util-linux package and is available
139 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
140 linux/⟩.
141
142
143
144util-linux April 2014 LSLOGINS(1)