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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.