Linux

From: Elwood Brooks <Elwood.Brooks_at_uc.edu>
Date: Mon, 12 Dec 2005 09:44:26 -0500

Thanks to everyone who responded to my query about the "last" command and
where the previous months list is stored for LINUX and UNIX OSs.

Several of you wanted me to forward the responses, so I will post them.

Most responses were for LINUX OSs, see blow:

For LINUX systems they are stored in wtmp.1 file. This may be accessed
through last -f /var/log/wtmp.1.

For SGIs and Solaris they may be stored in wtmp, wtmpx, OLDwtmpx, or
OLDwtmpx depending on the flavor of the OS. They may be accessed
/var/log/???? or /var/adm/???? depending on the system.

Most LINUX systems go back only one month by overwriting the wtmp.1
file. Karen Ann suggested going into the /etc/logrotate.conf file and
changing the rotate number from 1 to 12. Therefore older files like wtmp.2
etc. will be stored and one can store 12 months of files if wanted.

Russ Hopson suggested sorting the wtmp.1 file and directing it to a temp
file by:

last -f /var/log/wtmp.1 | sort -k 2,2 | grep -v pts | grep ":0" | grep -v
reboot | grep -v root | grep -v nmrsu > temp (hope I didn't make a mistake,
but you get the picture)

This will filter the file to give only log ins and time on.

Thanks again guys,

Elwood






_____________________________________________________________

Elwood Brooks, Ph.D. Phone: (513)556-9211
Department of Chemistry Fax: (513)556-9239
University of Cincinnati
P. O. Box 210172
Cincinnati, OH 45221-0172 E-mail: Elwood.Brooks_at_uc.edu
_____________________________________________________________
Received on Mon Dec 12 2005 - 12:31:58 MST

This archive was generated by hypermail 2.4.0 : Sun Jun 11 2023 - 13:34:36 MST