Emptying a log file in Linux
How to clean a log file in Linux? – Over time it gets necessary to truncate log files. Expanding log files may not be easy to read. In Linux emptying a log file is easily achieved by issuing some basics commands. To remove or truncate a file, we can use /dev/null, which is utilized to discard text.
Be sure NOT to clean ANY file. Some files may be needed and should not be truncated.
To truncate or clean up a log file, do following:
You can use alternative methods to achieve same result: