xref: /original-bsd/share/man/man5/utmp.5 (revision 2c12987e)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)utmp.5 6.6 (Berkeley) 06/23/90

UTMP 5 ""
C 4
NAME
utmp, wtmp - login records
SYNOPSIS
#include <utmp.h>
DESCRIPTION
The utmp file records information about who is currently using the system. The file is a sequence of entries with the following structure, as defined in the include file.

#define UT_NAMESIZE 8
#define UT_LINESIZE 8
#define UT_HOSTSIZE 16
struct utmp {
 char ut_line[UT_NAMESIZE];
 char ut_name[UT_LINESIZE];
 char ut_host[UT_HOSTSIZE];
 time_t ut_time;
};

This structure gives the name of the special file associated with the user's terminal, the user's login name, and the time of the login in the form of time (3).

The wtmp file records all logins and logouts. A null user name indicates a logout on the associated terminal. Furthermore, the terminal name `~' indicates that the system was rebooted at the indicated time; in such cases the name will be ``shutdown''. An adjacent pair of entries with terminal names `\^|\^' and `{' indicate the system-maintained time just before and just after a date command has changed the system's idea of the time. The name for both entries will be ``date''.

Wtmp is maintained by login (1) and init (8). Neither of these programs creates the file, so if it is removed record-keeping is turned off. It is summarized by last (1) and ac (8).

FILES
/var/run/utmp

/var/log/wtmp

"SEE ALSO"
last(1), login(1), who(1), ac(8), init(8)