Clearing logs in Linux

As with all operating systems, logs are also generated and stored on Linux-based systems. Log files are the records of all activities that took place on a system. The following are the general locations of the Linux log files:

The following are additional log locations on Linux systems:

  • Example 1: Clearing logs using null

In this example, we are going to use null, a non-existent object, to remove the contents of a file. We are going to clear the logs of the Apache access.log file on a Linux system. A null object is ...

Get Hands-On Penetration Testing with Kali NetHunter now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.