1LASTLOG(8) System Management Commands LASTLOG(8)
2
3
4
6 lastlog - reports the most recent login of all users or of a given user
7
9 lastlog [options]
10
12 lastlog formats and prints the contents of the last login log
13 /var/log/lastlog file. The login-name, port, and last login time will
14 be printed. The default (no flags) causes lastlog entries to be
15 printed, sorted by their order in /etc/passwd.
16
18 The options which apply to the lastlog command are:
19
20 -b, --before DAYS
21 Print only lastlog records older than DAYS.
22
23 -h, --help
24 Display help message and exit.
25
26 -t, --time DAYS
27 Print the lastlog records more recent than DAYS.
28
29 -u, --user LOGIN|RANGE
30 Print the lastlog record of the specified user(s).
31
32 The users can be specified by a login name, a numerical user ID, or
33 a RANGE of users. This RANGE of users can be specified with a min
34 and max values (UID_MIN-UID_MAX), a max value (-UID_MAX), or a min
35 value (UID_MIN-).
36
37 If the user has never logged in the message ** Never logged in** will
38 be displayed instead of the port and time.
39
40 Only the entries for the current users of the system will be displayed.
41 Other entries may exist for users that were deleted previously.
42
44 The lastlog file is a database which contains info on the last login of
45 each user. You should not rotate it. It is a sparse file, so its size
46 on the disk is usually much smaller than the one shown by "ls -l"
47 (which can indicate a really big file if you have in passwd users with
48 a high UID). You can display its real size with "ls -s".
49
51 /var/log/lastlog
52 Database times of previous user logins.
53
55 Large gaps in UID numbers will cause the lastlog program to run longer
56 with no output to the screen (i.e. if in lastlog database there is no
57 entries for users with UID between 170 and 800 lastlog will appear to
58 hang as it processes entries with UIDs 171-799).
59
60
61
62System Management Commands 07/24/2009 LASTLOG(8)