utmp, wtmp, btmp and variants such as utmpx, wtmpx and btmpx are files on Unix-like systems that keep track of all logins and logouts to the system.
The wtmp and btmp format are exactly like utmp except that a null value for "username" indicates a logout on the associated terminal (the actual user name is located by finding the preceding login on that terminal).
[3] The utmp, wtmp and btmp files were never a part of any official Unix standard, such as Single UNIX Specification, while utmpx and corresponding APIs are part of it.
[4][5] While some systems create different newer files for the utmpx variants and have deprecated/obsoleted former formats, this is not always the case.
Depending on the system, those files may commonly be found in different places (non-exhaustive list) :