/var/adm/wtmp Truncation

From UNIX Systems Administration
Revision as of 12:58, 30 July 2014 by Michael Kohler (talk | contribs) (Created page with "== Truncating /var/adm/wtmp == # Convert /var/adm/wtmp file to ASCII. ## <tt>'''# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.out'''</tt> # Output the last 50 entries to ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Truncating /var/adm/wtmp

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

Further Reading

  1. Computers-it. AIX - How to truncate /var/adm/wtmp