]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/lslogins.1.adoc
build-sys: release++ (v2.38.1)
[thirdparty/util-linux.git] / login-utils / lslogins.1.adoc
CommitLineData
295b3979 1//po4a: entry man manual
a7574d88
MB
2// Copyright 2014 Ondrej Oprala (ondrej.oprala@gmail.com)
3// May be distributed under the GNU General Public License
4= lslogins(1)
5:doctype: manpage
f42ed819 6:man manual: User Commands
a7574d88
MB
7:man source: util-linux {release-version}
8:page-layout: base
9:command: lslogins
10
11== NAME
12
13lslogins - display information about known users in the system
14
15== SYNOPSIS
16
62fde24f 17*lslogins* [options] [*-s*|*-u*[=_UID_]] [*-g* _groups_] [*-l* _logins_] [_username_]
a7574d88
MB
18
19== DESCRIPTION
20
21Examine the wtmp and btmp logs, _/etc/shadow_ (if necessary) and _/passwd_ and output the desired data.
22
23The optional argument _username_ forces *lslogins* to print all available details about the specified user only. In this case the output format is different than in case of *-l* or *-g* and unknown is _username_ reported as an error.
24
25The default action is to list info about all the users in the system.
26
27== OPTIONS
28
29Mandatory arguments to long options are mandatory for short options too.
30
31*-a*, *--acc-expiration*::
62fde24f 32Display data about the date of last password change and the account expiration date (see *shadow*(5) for more info). (Requires root privileges.)
a7574d88 33
62fde24f
MB
34*--btmp-file* _path_::
35Alternate path for btmp.
a7574d88
MB
36
37*-c*, *--colon-separate*::
62fde24f 38Separate info about each user with a colon instead of a newline.
a7574d88
MB
39
40*-e*, *--export*::
9c7e81ff 41Output data in the format of NAME=VALUE. See also option *--shell*.
a7574d88
MB
42
43*-f*, *--failed*::
62fde24f 44Display data about the users' last failed login attempts.
a7574d88
MB
45
46*-G*, *--supp-groups*::
62fde24f 47Show information about supplementary groups.
a7574d88
MB
48
49*-g*, **--groups**=_groups_::
62fde24f
MB
50Only show data of users belonging to _groups_. More than one group may be specified; the list has to be comma-separated. Unknown group names are ignored.
51+
bd67ca44 52Note that the relation between user and group may be invisible for the primary group if the user is not explicitly specified as group member (e.g., in _/etc/group_). If the command *lslogins* scans for groups then it uses the groups database only, and the user database with primary GID is not used at all.
a7574d88 53
a7574d88 54*-L*, *--last*::
62fde24f 55Display data containing information about the users' last login sessions.
a7574d88
MB
56
57*-l*, **--logins**=_logins_::
bd67ca44 58Only show data of users with a login specified in _logins_ (user names or user IDs). More than one login may be specified; the list has to be comma-separated. Unknown login names are ignored.
a7574d88
MB
59
60*-n*, *--newline*::
62fde24f 61Display each piece of information on a separate line.
a7574d88
MB
62
63*--noheadings*::
62fde24f 64Do not print a header line.
a7574d88
MB
65
66*--notruncate*::
62fde24f 67Don't truncate output.
a7574d88
MB
68
69*-o*, *--output* _list_::
62fde24f 70Specify which output columns to print. The default list of columns may be extended if _list_ is specified in the format _+list_.
a7574d88
MB
71
72*--output-all*::
62fde24f 73Output all available columns. *--help* to get a list of all supported columns.
a7574d88
MB
74
75*-p*, *--pwd*::
bd67ca44 76Display information related to login by password (see also *-afL*).
a7574d88
MB
77
78*-r*, *--raw*::
62fde24f 79Raw output (no columnation).
a7574d88
MB
80
81*-s*, *--system-accs*::
bd67ca44 82Show system accounts. These are by default all accounts with a UID between 101 and 999 (inclusive), with the exception of either nobody or nfsnobody (UID 65534). This hardcoded default may be overwritten by parameters *SYS_UID_MIN* and *SYS_UID_MAX* in the file _/etc/login.defs_.
a7574d88
MB
83
84*--time-format* _type_::
62fde24f 85Display dates in short, full or iso format. The default is short, this time format is designed to be space efficient and human readable.
a7574d88
MB
86
87*-u*, *--user-accs*::
62fde24f 88Show user accounts. These are by default all accounts with UID above 1000 (inclusive), with the exception of either nobody or nfsnobody (UID 65534). This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in the file _/etc/login.defs_.
a7574d88 89
2b2d3172 90include::man-common/help-version.adoc[]
a7574d88
MB
91
92*--wtmp-file* _path_::
62fde24f 93Alternate path for wtmp.
a7574d88
MB
94
95*--lastlog* _path_::
62fde24f 96Alternate path for *lastlog*(8).
a7574d88 97
9c7e81ff
KZ
98*y-*, *--shell*::
99The column name will be modified to contain only characters allowed for shell variable identifiers. This is usable, for example, with *--export*. Note that this feature has been automatically enabled for *--export* in version 2.37, but due to compatibility issues, now it's necessary to request this behavior by *--shell*.
100
a7574d88 101*-Z*, *--context*::
62fde24f 102Display the users' security context.
a7574d88
MB
103
104*-z*, *--print0*::
62fde24f 105Delimit user entries with a nul character, instead of a newline.
a7574d88
MB
106
107== EXIT STATUS
108
1090::
62fde24f 110if OK,
a7574d88
MB
111
1121::
62fde24f 113if incorrect arguments specified,
a7574d88
MB
114
1152::
62fde24f 116if a serious error occurs (e.g., a corrupt log).
a7574d88
MB
117
118== NOTES
119
120The default UID thresholds are read from _/etc/login.defs_.
121
122== HISTORY
123
124The *lslogins* utility is inspired by the *logins* utility, which first appeared in FreeBSD 4.10.
125
126== AUTHORS
127
62fde24f 128mailto:ooprala@redhat.com[Ondrej Oprala],
a7574d88
MB
129mailto:kzak@redhat.com[Karel Zak]
130
131== SEE ALSO
132
133*group*(5),
134*passwd*(5),
135*shadow*(5),
136*utmp*(5)
137
625e9c61 138include::man-common/bugreports.adoc[]
a7574d88 139
625e9c61 140include::man-common/footer.adoc[]
a7574d88
MB
141
142ifdef::translation[]
625e9c61 143include::man-common/translation.adoc[]
a7574d88 144endif::[]