1833873 Members
2149 Online
110063 Solutions
New Discussion

last command not working

 
Yan Wong
Frequent Advisor

last command not working

Hi folks,

When I run the "last" command on my unix box command line, the result is something like the following:
# last yanw
Memory fault(coredump)

any ideas?
5 REPLIES 5
Rajeev  Shukla
Honored Contributor

Re: last command not working

Compare the /usr/bin/last file for corruption with other machine. Also make sure you have right permission in /var/adm which is 755 and adm:adm and make sure you have /var/adm/wtmp file.

Rajeev
Animesh Chakraborty
Honored Contributor

Re: last command not working

Hi,
Your /var/adm/wtmp is corrupted.
Create a new one.
#>wtmp
or
rm wtmp
touch wtmp
chown adm:adm wtmp
Did you take a backup?
avsrini
Trusted Contributor

Re: last command not working

Hi,
Seems your wtmp file is corrupted. touch the file

# > /var/adm/wtmp and change the owner and permissions.

Srini.
Be on top.
Steven E. Protter
Exalted Contributor

Re: last command not working

You'll flunk a security audit if you don't have a wtmp file. Just advice that you are strongly urged to have one.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
T G Manikandan
Honored Contributor

Re: last command not working

Looks like the wtmp file is corrupt.

#cd /var/adm
#mv wtmp wtmp.old
#touch wtmp
#chmod 644 wtmp

The reason for moving the wtmp is that the old information can be had from it

#/usr/sbin/acct/fwtmp < /var/adm/wtmp.old >/tmp/wtmpascii