]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/lslogins.1
scriptreplay: cleanup usage()
[thirdparty/util-linux.git] / login-utils / lslogins.1
CommitLineData
ab1cfad5
OO
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"
4.SH NAME
5lslogins \- display information about known users in the system
6.SH SYNOPSIS
7.B lslogins
f49ccec2
BS
8[options]
9.RB [ \-s | \-u [ =\fIUID ]]
10.RB [ \-g " \fIgroups\fR]"
11.RB [ \-l " \fIlogins\fR]"
09a4313c 12.RB [\fIusername\fR]
ab1cfad5
OO
13.SH DESCRIPTION
14.PP
15Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd
16and output the desired data.
09a4313c
KZ
17
18The optional argument \fIusername\fR forces
19.BR lslogins
20to print all available details about the specified user only. In this case the
ba1e2034
KZ
21output format is different than in case of \fB\-l\fR or \fB\-g\fR and unknown
22is \fIusername\fR reported as an error.
09a4313c 23
ab1cfad5 24.PP
ab1cfad5
OO
25The default action is to list info about all the users in the system.
26.SH OPTIONS
ce969b16 27Mandatory arguments to long options are mandatory for short options too.
ab1cfad5
OO
28.TP
29\fB\-a\fR, \fB\-\-acc\-expiration\fR
512abd56 30Display data about the date of last password change and the account expiration
a55f60a1 31date (see \fBshadow\fR(5) for more info). (Requires root privileges.)
ce969b16
BS
32.TP
33\fB\-\-btmp\-file \fIpath\fP
34Alternate path for btmp.
ab1cfad5 35.TP
512abd56 36\fB\-c\fR, \fB\-\-colon\-separate\fR
ab1cfad5
OO
37Separate info about each user with a colon instead of a newline.
38.TP
ab1cfad5
OO
39\fB\-e\fR, \fB\-\-export\fR
40Output data in the format of NAME=VALUE.
41.TP
42\fB\-f\fR, \fB\-\-failed\fR
43Display data about the users' last failed login attempts.
44.TP
228bb39a 45\fB\-G\fR, \fB\-\-supp\-groups\fR
6047c6db 46Show information about supplementary groups.
8b13a4d8 47.TP
ce969b16
BS
48\fB\-g\fR, \fB\-\-groups\fR=\fIgroups\fR
49Only show data of users belonging to \fIgroups\fR. More than one group
09a4313c
KZ
50may be specified; the list has to be comma-separated. The unknown group
51names are ignored.
6047c6db
KZ
52
53Note that relation between user and group may be invisible for primary group if
54the user is not explicitly specify as group member (e.g. in /etc/group). If the
55command lslogins scans for groups than it uses groups database only, and user
56database with primary GID is not used at all.
ab1cfad5 57.TP
ce969b16
BS
58\fB\-h\fR, \fB\-\-help\fR
59Display help information and exit.
ab1cfad5 60.TP
ce969b16 61\fB\-L\fR, \fB\-\-last\fR
512abd56
KZ
62Display data containing information about the users' last login sessions.
63.TP
ce969b16
BS
64\fB\-l\fR, \fB\-\-logins\fR=\fIlogins\fR
65Only show data of users with a login specified in \fIlogins\fR (user names or user
66IDS). More than one login may be specified; the list has to be comma-separated.
09a4313c 67The unknown login names are ignored.
ce969b16 68.TP
ab1cfad5
OO
69\fB\-n\fR, \fB\-\-newline\fR
70Display each piece of information on a separate line.
71.TP
4b6ae071
KZ
72\fB\-\-noheadings\fR
73Do not print a header line.
74.TP
512abd56
KZ
75\fB\-\-notruncate\fR
76Don't truncate output.
77.TP
ce969b16 78\fB\-o\fR, \fB\-\-output \fIlist\fP
2bb3aa36 79Specify which output columns to print.
fa7709db
KZ
80The default list of columns may be extended if \fIlist\fP is
81specified in the format \fI+list\fP.
2ab432ef
SK
82.TP
83.B \-\-output\-all
84Output all available columns.
512abd56
KZ
85.B \-\-help
86to get a list of all supported columns.
b3f4f056 87.TP
ce969b16
BS
88\fB\-p\fR, \fB\-\-pwd\fR
89Display information related to login by password (see also \fB\-afL).
ab1cfad5
OO
90.TP
91\fB\-r\fR, \fB\-\-raw\fR
92Raw output (no columnation).
93.TP
2b8a9bda 94\fB\-s\fR, \fB\-\-system\-accs\fR
0d37969c
SB
95Show 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).
97This hardcoded default may be overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in
2b8a9bda 98the file /etc/login.defs.
ab1cfad5 99.TP
b06c1ca6 100\fB\-\-time\-format\fR \fItype\fP
ce969b16 101Display dates in short, full or iso format. The default is short, this time
ea24eacc 102format is designed to be space efficient and human readable.
512abd56 103.TP
2b8a9bda 104\fB\-u\fR, \fB\-\-user\-accs\fR
ce969b16 105Show user accounts. These are by default all accounts with UID above 1000
2b8a9bda
KZ
106(inclusive), with the exception of either nobody or nfsnobody (UID 65534).
107This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in
108the file /etc/login.defs.
ab1cfad5 109.TP
ce969b16
BS
110\fB\-V\fR, \fB\-\-version\fR
111Display version information and exit.
29cc2a55 112.TP
512abd56
KZ
113\fB\-\-wtmp\-file \fIpath\fP
114Alternate path for wtmp.
115.TP
ce969b16
BS
116\fB\-Z\fR, \fB\-\-context\fR
117Display the users' security context.
512abd56 118.TP
ce969b16
BS
119\fB\-z\fR, \fB\-\-print0\fR
120Delimit user entries with a nul character, instead of a newline.
ab1cfad5 121
512abd56 122.SH NOTES
ce969b16 123The default UID thresholds are read from /etc/login.defs.
ab1cfad5 124
ab1cfad5
OO
125.SH EXIT STATUS
126.TP
1270
128if OK,
129.TP
1301
131if incorrect arguments specified,
132.TP
1332
134if a serious error occurs (e.g. a corrupt log).
135.SH SEE ALSO
136\fBgroup\fP(5), \fBpasswd\fP(5), \fBshadow\fP(5), \fButmp\fP(5)
137.SH HISTORY
138The \fBlslogins\fP utility is inspired by the \fBlogins\fP utility, which first appeared in FreeBSD 4.10.
139.SH AUTHORS
b3f4f056 140.MT ooprala@redhat.com
ab1cfad5
OO
141Ondrej Oprala
142.ME
b3f4f056
KZ
143.br
144.MT kzak@redhat.com
145Karel Zak
146.ME
147
ab1cfad5
OO
148.SH AVAILABILITY
149The lslogins command is part of the util-linux package and is available from
d673b74e 150.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
ab1cfad5
OO
151Linux Kernel Archive
152.UE .