clear apache error log ubuntu code example Example: clear error log apache2 $ sudo truncate -s 0 /path/to/log.log