I needed to clear my logfile but I didnt want to go through the hassle of deleting, creating, and worrying about permissions

Heres a command to just simply clear it.


# Method 1
truncate logfile --size 0

# Method 2
cat /dev/null > logfile

# Method 3
> logfile


Related External Links: