logins(1)logins(1)NAMElogins - Lists user account information
SYNOPSISlogins [-adDmopstux] [-z string] [-g groups] [-l logins]
OPTIONS
Displays two additional fields indicating password expiration. The
first shows the number of days remaining before the password expires.
The second shows the date when the password expires. Causes logins to
list system-specific default attributes. You must be root to run logins
with this option. This option causes logins to list system-specific
default attributes. Displays only those logins who have duplicate user
IDs. Displays logins of all users belonging to the specified group.
You can specify multiple groups as a comma separated list. If this
option is used with the -l option, the user only will be listed once,
even if the user belongs to more than one group. Displays an individ‐
ual login or a group of logins, which are specified as a comma sepa‐
rated list. Reports an additional line of group information for each
group the login belongs to. Reports the output in colon separated
fields. Displays only the logins that do not have passwords. Displays
logins whose user ID is less than 100; these are system logins. Sorts
the output by login name. The default is to sort by user ID. Displays
logins whose user ID is greater than or equal to 100; these are user
logins. Extends the information for each user by displaying on subse‐
quent lines the user's home directory, the user's login shell, and the
password information. The password information consists of two charac‐
ters indicating the password status (PS means password, NP means no
password or LK for locked) followed by four fields indicating password
aging information. This information shows the last date the password
was changed, the number of days when a password remains in effect, the
number of days required until the password must be changed again, and
the number of days before the password expires when the user will be
given a password expiration warning message on logging in. Where
string can be either distributed=n or local=n.
If string is distributed=n (where the value of n can be either 0
or 1), this option indicates that the group is distributed. If
n is 1, the login is maintained across an NIS cell. If n is 0,
the login is maintained on the local system only.
If string is local=n (where the value of n can be either 0 or
1), this option indicates that the login is local. If n is 1,
the login exists in a local database. If n is 0, the login
information does not exist in a local database, but may exist
within the NIS cell.
The following table explains the valid combinations for the -z
distributed and -z local flags:
NIS local= distributed= Result
non-NIS 0 0 Illegal option
0 1 Illegal
option
1 0 Local Data‐
base
1 1 Illegal
option
NIS client 0 0 Illegal option
0 1 Distributed
Database
1 0 Local Data‐
base
1 1 Both Data‐
bases
NIS master 0 0 Illegal option
0 1 Distributed
Database
1 0 Local Data‐
base
1 1 Both Data‐
bases
The combination of -z distributed=1 and -z local=1 reports login
information for both local and distributed NIS databases.
DESCRIPTION
The logins command displays a list of user accounts and information on
the specified user account or accounts.
Without arguments, logins lists all the users, one on each line.
On a non-NIS system, logins displays only the local accounts. On a NIS-
CLIENT or NIS-MASTER system. If a user is on an NIS-CLIENT or NIS-MAS‐
TER database, the loginscommand displays both the local and the dis‐
tributed accounts.
Options may be used together. If so, any login matching any criteria
will be displayed. When the -l and -g options are combined, a user will
only be listed once, even if they belong to more than one of the
selected groups.
EXAMPLES
The following example shows how to display the login information for
all users. $ logins
The following example shows how to display login information about the
user with the login name phil. $ logins-l phil
The following example shows how to display login information about the
users with the login names bob and ray. $ logins-l bob,ray
The following example shows how to display login information about the
users who belong to the group named team. $ logins-g team
The following example shows how to display login information about the
users who belong to the groups named support or research. $ logins-g
support,research
The following example shows how to display extended login information
about the user with the login name john. $ logins-x -l john The fol‐
lowing example shows how to display all users who have multiple User
IDs. $ logins-d
The following example shows how to display the user defaults for the
system. $ logins-D
You must be root to use this option. The following example
shows how to display the login information for all users with
system user accounts (that is, User IDs less than 100). $
logins-s
The following example shows how to display information on the
network user with the login name john. $ logins-z distrib‐
uted=1 -l john
FILES
The logins command uses the user database for the given level of system
security.
SEE ALSO
Commands: groupadd(8), groupmod(8), groupdel(8), passwd(8), useradd(8),
usermod(8), userdel(8)logins(1)