/var/adm/wtmp Truncation: Difference between revisions
Jump to navigation
Jump to search
(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 ...") |
No edit summary |
||
Line 1: | Line 1: | ||
== Truncating /var/adm/wtmp == | == Truncating /var/adm/wtmp == | ||
# Convert /var/adm/wtmp file to ASCII. | # Convert <tt>'''/var/adm/wtmp'''</tt> file to ASCII. | ||
## <tt>'''# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.out'''</tt> | ## <tt>'''# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.out'''</tt> | ||
# Output the last 50 entries to a new file. | # Output the last 50 entries to a new file. | ||
## <tt>'''# tail -50 /tmp/wtmp.out > /tmp/wtmp.in'''</tt> | ## <tt>'''# tail -50 /tmp/wtmp.out > /tmp/wtmp.in'''</tt> | ||
# Convert the /tmp/wtmp.in file to wtmp format, and read it back in. | # Convert the <tt>'''/tmp/wtmp.in'''</tt> file to wtmp format, and read it back in. | ||
## <tt>'''# /usr/sbin/acct/fwtmp -ic < /tmp/wtmp.in > /var/adm/wtmp'''</tt> | ## <tt>'''# /usr/sbin/acct/fwtmp -ic < /tmp/wtmp.in > /var/adm/wtmp'''</tt> | ||
# Remove the /tmp/wtmp.out and /tmp/wtmp.in files. | # Remove the <tt>'''/tmp/wtmp.out'''</tt> and <tt>'''/tmp/wtmp.in'''</tt> files. | ||
== Further Reading == | == Further Reading == |
Revision as of 13:35, 30 July 2014
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.