/var/adm/wtmp Truncation
Jump to navigation
Jump to search
Truncating /var/adm/wtmp
- Convert /var/adm/wtmp file to ASCII.
- # /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.out
- Output the last 50 entries to a new file.
- # tail -50 /tmp/wtmp.out > /tmp/wtmp.in
- Convert the /tmp/wtmp.in file to wtmp format, and read it back in.
- # /usr/sbin/acct/fwtmp -ic < /tmp/wtmp.in > /var/adm/wtmp
- Remove the /tmp/wtmp.out and /tmp/wtmp.in files.