]>
Commit | Line | Data |
---|---|---|
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 | |
5 | lslogins \- 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 | |
15 | Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd | |
16 | and output the desired data. | |
09a4313c KZ |
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 | |
ba1e2034 KZ |
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. | |
09a4313c | 23 | |
ab1cfad5 | 24 | .PP |
ab1cfad5 OO |
25 | The default action is to list info about all the users in the system. |
26 | .SH OPTIONS | |
ce969b16 | 27 | Mandatory arguments to long options are mandatory for short options too. |
ab1cfad5 OO |
28 | .TP |
29 | \fB\-a\fR, \fB\-\-acc\-expiration\fR | |
512abd56 | 30 | Display data about the date of last password change and the account expiration |
a55f60a1 | 31 | date (see \fBshadow\fR(5) for more info). (Requires root privileges.) |
ce969b16 BS |
32 | .TP |
33 | \fB\-\-btmp\-file \fIpath\fP | |
34 | Alternate path for btmp. | |
ab1cfad5 | 35 | .TP |
512abd56 | 36 | \fB\-c\fR, \fB\-\-colon\-separate\fR |
ab1cfad5 OO |
37 | Separate info about each user with a colon instead of a newline. |
38 | .TP | |
ab1cfad5 OO |
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 | |
228bb39a | 45 | \fB\-G\fR, \fB\-\-supp\-groups\fR |
6047c6db | 46 | Show information about supplementary groups. |
8b13a4d8 | 47 | .TP |
ce969b16 BS |
48 | \fB\-g\fR, \fB\-\-groups\fR=\fIgroups\fR |
49 | Only show data of users belonging to \fIgroups\fR. More than one group | |
09a4313c KZ |
50 | may be specified; the list has to be comma-separated. The unknown group |
51 | names are ignored. | |
6047c6db KZ |
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. | |
ab1cfad5 | 57 | .TP |
ce969b16 BS |
58 | \fB\-h\fR, \fB\-\-help\fR |
59 | Display help information and exit. | |
ab1cfad5 | 60 | .TP |
ce969b16 | 61 | \fB\-L\fR, \fB\-\-last\fR |
512abd56 KZ |
62 | Display data containing information about the users' last login sessions. |
63 | .TP | |
ce969b16 BS |
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. | |
09a4313c | 67 | The unknown login names are ignored. |
ce969b16 | 68 | .TP |
ab1cfad5 OO |
69 | \fB\-n\fR, \fB\-\-newline\fR |
70 | Display each piece of information on a separate line. | |
71 | .TP | |
4b6ae071 KZ |
72 | \fB\-\-noheadings\fR |
73 | Do not print a header line. | |
74 | .TP | |
512abd56 KZ |
75 | \fB\-\-notruncate\fR |
76 | Don't truncate output. | |
77 | .TP | |
ce969b16 | 78 | \fB\-o\fR, \fB\-\-output \fIlist\fP |
2bb3aa36 | 79 | Specify which output columns to print. |
fa7709db KZ |
80 | The default list of columns may be extended if \fIlist\fP is |
81 | specified in the format \fI+list\fP. | |
2ab432ef SK |
82 | .TP |
83 | .B \-\-output\-all | |
84 | Output all available columns. | |
512abd56 KZ |
85 | .B \-\-help |
86 | to get a list of all supported columns. | |
b3f4f056 | 87 | .TP |
ce969b16 BS |
88 | \fB\-p\fR, \fB\-\-pwd\fR |
89 | Display information related to login by password (see also \fB\-afL). | |
ab1cfad5 OO |
90 | .TP |
91 | \fB\-r\fR, \fB\-\-raw\fR | |
92 | Raw output (no columnation). | |
93 | .TP | |
2b8a9bda | 94 | \fB\-s\fR, \fB\-\-system\-accs\fR |
0d37969c SB |
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 | |
2b8a9bda | 98 | the file /etc/login.defs. |
ab1cfad5 | 99 | .TP |
b06c1ca6 | 100 | \fB\-\-time\-format\fR \fItype\fP |
ce969b16 | 101 | Display dates in short, full or iso format. The default is short, this time |
ea24eacc | 102 | format is designed to be space efficient and human readable. |
512abd56 | 103 | .TP |
2b8a9bda | 104 | \fB\-u\fR, \fB\-\-user\-accs\fR |
ce969b16 | 105 | Show 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). |
107 | This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in | |
108 | the file /etc/login.defs. | |
ab1cfad5 | 109 | .TP |
ce969b16 BS |
110 | \fB\-V\fR, \fB\-\-version\fR |
111 | Display version information and exit. | |
29cc2a55 | 112 | .TP |
512abd56 KZ |
113 | \fB\-\-wtmp\-file \fIpath\fP |
114 | Alternate path for wtmp. | |
115 | .TP | |
ce969b16 BS |
116 | \fB\-Z\fR, \fB\-\-context\fR |
117 | Display the users' security context. | |
512abd56 | 118 | .TP |
ce969b16 BS |
119 | \fB\-z\fR, \fB\-\-print0\fR |
120 | Delimit user entries with a nul character, instead of a newline. | |
ab1cfad5 | 121 | |
512abd56 | 122 | .SH NOTES |
ce969b16 | 123 | The default UID thresholds are read from /etc/login.defs. |
ab1cfad5 | 124 | |
ab1cfad5 OO |
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 | |
b3f4f056 | 140 | .MT ooprala@redhat.com |
ab1cfad5 OO |
141 | Ondrej Oprala |
142 | .ME | |
b3f4f056 KZ |
143 | .br |
144 | .MT kzak@redhat.com | |
145 | Karel Zak | |
146 | .ME | |
147 | ||
ab1cfad5 OO |
148 | .SH AVAILABILITY |
149 | The 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 |
151 | Linux Kernel Archive |
152 | .UE . |