Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

utmp(4) [osf1 man page]

utmp(4) 						     Kernel Interfaces Manual							   utmp(4)

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 utmp entries, as defined in struct utmp in the utmp.h file. The utmp 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 ut_type field is the type of entry, which can specify several symbolic constant values. The symbolic constants are defined in the utmp.h file. The wtmp file records all logins and logouts. A null user name indicates a logout on the associated terminal. A terminal referenced with a tilde (~) indicates that the system was rebooted at the indicated time. The adjacent pair of entries with terminal names referenced by a vertical bar (|) or a right brace (}) indicate the system-maintained time just before and just after a date command has changed the sys- tem's time frame. The wtmp file 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. See ac(8) for information on the file. FILES
ac(8), init(8), last(8), lastcomm(8), login(1), who(1), wtmpconvert(8). delim off utmp(4)

Check Out this Related Man Page

UTMP(5) 							File Formats Manual							   UTMP(5)

utmp, wtmp - logged in users, login and logout history SYNOPSIS
#include <sys/types.h> #include <utmp.h> DESCRIPTION
The files /etc/utmp and /usr/adm/wtmp respectively contain the currently logged in users, and the history of logins and logouts. Each file is an array of the following structure defined in <utmp.h>: struct utmp { char ut_user[8]; /* user name */ char ut_line[12]; /* terminal name */ char ut_host[16]; /* host name, when remote */ time_t ut_time; /* login/logout time */ }; #define ut_name ut_user/* for compatibility with other systems */ The structure contains more fields than those listed, but they are only of interest to init and login. Note that the ut_name field is a compatibility alias for ut_user, it is actually better to use it. A login entry is completely specified. A logout entry has a null string for ut_name. A shutdown or reboot entry has an ut_line field con- taining a "~" (tilde). The ut_name field is usually the name of the program that did the shutdown, or "reboot" at reboot. This is a bit confusing, but note that there should always be two such entries. If you see just one entry then the system has crashed, if you see two entries then the system was properly shut down and later rebooted. FILES
/etc/utmp Currently logged in users. /usr/adm/wtmp History of logins and logouts. SEE ALSO
who(1), ttyslot(3). AUTHOR
Kees J. Bot ( UTMP(5)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Error login user file utmp

could probably help me with a unix problem. Basicallyu, when the users try to connect to the server they get this messge: No UTMP entry. you must exec "LOGIN" from the lowest level "sh" They are connecting using a windows emulator called TINYTERM. We cannot connect from the console either... (3 Replies)
Discussion started by: jernesto_diaz
3 Replies

2. SCO

SCO utmp file

I am tring to recover a SCO system remotely, when I try to login with multiple user support, i get the following message No UTPM entry, you must execute from the lowest level (sh) Can anyone shed some light on this issue. I have never came seen this error before. Also it will allow me to... (1 Reply)
Discussion started by: scott_williams1
1 Replies

3. UNIX for Dummies Questions & Answers

logout command

hi all The "last" command shows the last login time of the user. is there any command for last logout time. as usual, replies are appreciated. thanks boys. raguram R (6 Replies)
Discussion started by: raguramtgr
6 Replies

4. Programming


the utmp.h ACCOUNTING macro is set to 9 on my system. my question is: what "accounting" is it referring to? (2 Replies)
Discussion started by: thmnetwork
2 Replies

5. AIX

utmp files

Hi All, if someone know where I can set dimension of utmp log files like wtmp failedlogin sulog in an AIX system. These are called security logs and they can reach a max amount in day or MB, where can I steady their size ? thanks in advance. (2 Replies)
Discussion started by: Carmen123
2 Replies

6. Shell Programming and Scripting

finding null records in data file

I am having a "|" delimited flat file and I have to pick up all the records with the 2nd field having null value. Please suggest. (3 Replies)
Discussion started by: dsravan
3 Replies

7. AIX

Aix Server Restarted

Hi, I want to know how can we come to know who has system rebooted, I have given the command last but it showing the last user has login and logout after some time,but reboot command is showing after 10 mins,how can we trace that it is automatically rebooted or rebooted by some person, (2 Replies)
Discussion started by: manoj.solaris
2 Replies

8. Shell Programming and Scripting

Delete Duplicate records from a tilde delimited file

Hi All, I want to delete duplicate records from a tilde delimited file. Criteria is considering the first 2 fields, the combination of which has to be unique, below is a sample of records in the input file 1620000010338~2446694087~0~20061130220000~A00BCC1CT... (5 Replies)
Discussion started by: irshadm
5 Replies

9. Red Hat

Login Incorrect

I have rebooted my box (Redhat Linux) and the system is back online now, but Iam unable to login via ssh for all the users including root, it says "Login Incorrect". I am pretty sure the username/password is correct.May be the password or the shadow file is corrupted ??? How do i login to the... (6 Replies)
Discussion started by: sydney2008
6 Replies

10. UNIX for Dummies Questions & Answers

get all user's login time

hi all, i need yor help!!!:D i am a newbie in programming i want to get user list and their login time... i have search and learn about pswd and utmp, but i only can get usr list without their login time... do you have an idea to solve my problem? thanx (5 Replies)
Discussion started by: alif
5 Replies

11. UNIX for Dummies Questions & Answers

Help Needed using utmp file!

Hi. I am working on a small assignment where i need to extract the login information of currently logged in users in a Linux client-server environment.I am able to extract only the userID,IP/HOST name,TTY,device name,GID,PID and login time using the structure 'utmp'.Also when i am saving the... (2 Replies)
Discussion started by: maverixxx
2 Replies

12. OS X (Apple)

Login/Logout script

Dear readers I use SnowLeopard 10.6.2 and need to do some special tasks at login and logout of an sepcific user. My problem is, how do I send a string "login" respectively "logout" from computer "A", where the login/logout script runs, to computer "B" where some other tasks need to be done. ... (3 Replies)
Discussion started by: tthaler
3 Replies

13. Emergency UNIX and Linux Support

LAST command with Year

Hi Guys, I'm trying to identify the last logins by all the users in the system in AIX. the last command gives me the output, but there is no year displayed for it . Since there is a duplication of months i mean Apr 2010 and Apr 2009 also its giving me inaccurate data.. Is there a way I can filter... (4 Replies)
Discussion started by: kkeng808
4 Replies

14. BSD

How to get the FreeBsd system information?

Hi, How to get the FreeBsd system hardware and software basic information using terminal command with guest login? Here below i have specified some of the information i need. Please have a look at this and guide me. OS Name: OS Version : OS Manufacturer: OS... (2 Replies)
Discussion started by: forumguest
2 Replies

15. Shell Programming and Scripting

how to remove particular records from a file???

I need to remove header(H) and trailer(T) from a file keeping other records as such. The source file will look as below I have to remove H|20120203_000500|20120203_000500 and T| 10111246 from the above file. Please let me know how to do... (6 Replies)
Discussion started by: siteregsam
6 Replies

Featured Tech Videos