How to clear Linux login information and log

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

In this paper, in Linux, how to clear the access log, log log and used command method. A friend in need, refer to the next.

In the Linux system, how to clear the access log, log log and used command.?

The method introduced in this paper, all the log will delete all logs, which include system log, will be erased, the user will not be able to understand the past a certain time was what happened.

Use the following shell script:
 

Copy the code example code:

#!/usr/bin/bash
#edit www.jbxue.com
echo > /var/log/syslog
echo > /var/log/messages
echo > /var/log/httpd/access_log
echo > /var/log/httpd/error_log
echo > /var/log/xferlog
echo > /var/log/secure
echo > /var/log/auth.log
echo > /var/log/user.log
echo > /var/log/wtmp
echo > /var/log/lastlog
echo > /var/log/btmp
echo > /var/run/utmp
history -c

Code Description:
echo command, empty the log file, and then the command history records, use the history -c to clear.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Larry at November 10, 2013 - 3:39 PM