04-20-2005
I did try the "last" command, but it did not find the wtmp file in the /var/adm directory. Anyother suggestions?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
in unix what is the syntax to find out how many users are currently logged in (4 Replies)
Discussion started by: trichyselva
4 Replies
2. UNIX for Advanced & Expert Users
Im "supporting" at least 2500 HP-UX workstations with CAD-related software with the B.11.11 build. I cant say anymore than that because of my companys sligtly paranoid security policy .
The last few days a new problem has arised from nowhere.
The problem is that users gets logged off when the... (5 Replies)
Discussion started by: Laoinjo
5 Replies
3. Post Here to Contact Site Administrators and Moderators
how to find out users who logged out within 5 minutes (1 Reply)
Discussion started by: roshni
1 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I'm trying to do a list of user that never connected to a couple of servers. I want to do a diff between the servers lists, and print out only the users that never has logged on each server. Here my first step :
SERVER01:
# finger `egrep -v -e "^\s*#" /etc/passwd | awk '{ print $1 }' |... (4 Replies)
Discussion started by: gogol_bordello
4 Replies
5. Shell Programming and Scripting
I have searched the forums but have not mangaed to quite find what im looking for. I have used to /etc/passwd command to present me a list of all users the who command to present all users currently logged on, but what i want to know is what command can i use to display users that are registered... (12 Replies)
Discussion started by: warlock129
12 Replies
6. UNIX for Dummies Questions & Answers
I need to find what users are currently logged onto the system that is easy just a simple who | awk '{ print $1 }' (thats all I need for the part), but I also need to find how long they have been logged on and the total amount of file space they are using.
Thanks in advance, I have been looking... (3 Replies)
Discussion started by: mauler123
3 Replies
7. UNIX for Dummies Questions & Answers
How do I find this out? I have a feeling its a simple command such as who, but I just don't know what it is. I've had a search on here but either I can't put it into the right search criteria or there isn't a topic on it.
Thanks.
EDIT: Delete this thread, as I posted it I noticed the... (0 Replies)
Discussion started by: chris_rabz
0 Replies
8. Red Hat
I have 2 systems. (1) RHEL5 and (2) winXP pro
from xpPRO putty i ssh into rhel5 : user root
from xpPRO i ftp into rhel5 : user abc123
when i run #uptime it only shows 1 user
when i do #ps -u abc123 : it shows vsftpd deamon PID
is there a command that can be used to show all currently... (4 Replies)
Discussion started by: dplinux
4 Replies
9. Shell Programming and Scripting
Hi All,
I have a specific requirement wherein I want a list of users who have logged in between 10:00 AM and 11:30 AM.
Thanks,
vini (4 Replies)
Discussion started by: vini kumar
4 Replies
10. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Show all users who are currently logged in, sorted from earliest to latest log in time. The log in time includes the month, day, and time.
2. Relevant commands, code, scripts, algorithms:
finger, who, sort, pipe, head, tail,
... (8 Replies)
Discussion started by: vtmd
8 Replies
LEARN ABOUT NETBSD
lastlog
UTMP(5) BSD File Formats Manual UTMP(5)
NAME
utmp, wtmp, lastlog -- login records
SYNOPSIS
#include <utmp.h>
DESCRIPTION
The file <utmp.h> declares the structures used to record information about current users in the file utmp, logins and logouts in the file
wtmp, and last logins in the file lastlog. The time stamps of date changes, shutdowns and reboots are also logged in the wtmp file.
The wtmp file can grow rapidly on busy systems, and is normally rotated with newsyslog(8).
These files must be created manually; if they do not exist, they are not created automatically.
#define _PATH_UTMP "/var/run/utmp"
#define _PATH_WTMP "/var/log/wtmp"
#define _PATH_LASTLOG "/var/log/lastlog"
#define UT_NAMESIZE 8
#define UT_LINESIZE 8
#define UT_HOSTSIZE 16
struct lastlog {
time_t ll_time;
char ll_line[UT_LINESIZE];
char ll_host[UT_HOSTSIZE];
};
struct utmp {
char ut_line[UT_LINESIZE];
char ut_name[UT_NAMESIZE];
char ut_host[UT_HOSTSIZE];
time_t ut_time;
};
Each time a user logs in, the login(1) program looks up the user's UID in the file lastlog. If it is found, the timestamp of the last time
the user logged in, the terminal line and the hostname are written to the standard output, providing the login is not set quiet; see
login(1). The login(1) program then records the new login time in the file lastlog.
After the new lastlog record is written, the file utmp is opened and the utmp record for the user inserted. This record remains there until
the user logs out at which time it is deleted (by clearing the user and host fields, and updating the timestamp field). The utmp file is
used by the programs rwho(1), users(1), w(1), and who(1).
Next, the login(1) program opens the file wtmp, and appends the user's utmp record. When the user logs out, a utmp record with the tty line,
an updated time stamp, and cleared user and host fields is appended to the file by init(8). The wtmp file is used by the programs last(1)
and ac(8).
In the event of a date change, a shutdown or reboot, the following items are logged in the wtmp file.
reboot
shutdown A system reboot or shutdown has been initiated. The character '~' is placed in the field ut_line, and reboot or shutdown in the
field ut_name (see shutdown(8) and reboot(8)).
date The system time has been manually or automatically updated by date(1). The command name date is recorded in the field ut_name.
In the field ut_line, the character '|' indicates the time prior to the change, and the character '{' indicates the new time.
FILES
/var/run/utmp The utmp file.
/var/log/wtmp The wtmp file.
/var/log/lastlog The lastlog file.
SEE ALSO
last(1), login(1), w(1), who(1), utmpx(5), ac(8), init(8), lastlogin(8), newsyslog(8)
HISTORY
A utmp and wtmp file format appeared in Version 6 AT&T UNIX. The lastlog file format appeared in 3.0BSD.
BSD
May 14, 2003 BSD