]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/lslogins.1
scriptreplay: cleanup usage()
[thirdparty/util-linux.git] / login-utils / lslogins.1
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
5 lslogins \- display information about known users in the system
6 .SH SYNOPSIS
7 .B lslogins
8 [options]
9 .RB [ \-s | \-u [ =\fIUID ]]
10 .RB [ \-g " \fIgroups\fR]"
11 .RB [ \-l " \fIlogins\fR]"
12 .RB [\fIusername\fR]
13 .SH DESCRIPTION
14 .PP
15 Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd
16 and output the desired data.
17
18 The optional argument \fIusername\fR forces
19 .BR lslogins
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.
23
24 .PP
25 The default action is to list info about all the users in the system.
26 .SH OPTIONS
27 Mandatory arguments to long options are mandatory for short options too.
28 .TP
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.)
32 .TP
33 \fB\-\-btmp\-file \fIpath\fP
34 Alternate path for btmp.
35 .TP
36 \fB\-c\fR, \fB\-\-colon\-separate\fR
37 Separate info about each user with a colon instead of a newline.
38 .TP
39 \fB\-e\fR, \fB\-\-export\fR
40 Output data in the format of NAME=VALUE.
41 .TP
42 \fB\-f\fR, \fB\-\-failed\fR
43 Display data about the users' last failed login attempts.
44 .TP
45 \fB\-G\fR, \fB\-\-supp\-groups\fR
46 Show information about supplementary groups.
47 .TP
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
51 names are ignored.
52
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.
57 .TP
58 \fB\-h\fR, \fB\-\-help\fR
59 Display help information and exit.
60 .TP
61 \fB\-L\fR, \fB\-\-last\fR
62 Display data containing information about the users' last login sessions.
63 .TP
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.
68 .TP
69 \fB\-n\fR, \fB\-\-newline\fR
70 Display each piece of information on a separate line.
71 .TP
72 \fB\-\-noheadings\fR
73 Do not print a header line.
74 .TP
75 \fB\-\-notruncate\fR
76 Don't truncate output.
77 .TP
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.
82 .TP
83 .B \-\-output\-all
84 Output all available columns.
85 .B \-\-help
86 to get a list of all supported columns.
87 .TP
88 \fB\-p\fR, \fB\-\-pwd\fR
89 Display information related to login by password (see also \fB\-afL).
90 .TP
91 \fB\-r\fR, \fB\-\-raw\fR
92 Raw output (no columnation).
93 .TP
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.
99 .TP
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.
103 .TP
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.
109 .TP
110 \fB\-V\fR, \fB\-\-version\fR
111 Display version information and exit.
112 .TP
113 \fB\-\-wtmp\-file \fIpath\fP
114 Alternate path for wtmp.
115 .TP
116 \fB\-Z\fR, \fB\-\-context\fR
117 Display the users' security context.
118 .TP
119 \fB\-z\fR, \fB\-\-print0\fR
120 Delimit user entries with a nul character, instead of a newline.
121
122 .SH NOTES
123 The default UID thresholds are read from /etc/login.defs.
124
125 .SH EXIT STATUS
126 .TP
127 0
128 if OK,
129 .TP
130 1
131 if incorrect arguments specified,
132 .TP
133 2
134 if 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
138 The \fBlslogins\fP utility is inspired by the \fBlogins\fP utility, which first appeared in FreeBSD 4.10.
139 .SH AUTHORS
140 .MT ooprala@redhat.com
141 Ondrej Oprala
142 .ME
143 .br
144 .MT kzak@redhat.com
145 Karel Zak
146 .ME
147
148 .SH AVAILABILITY
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/
151 Linux Kernel Archive
152 .UE .