Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to trim log file linux

truncate -s 0 logfile

Where -s is used to set or adjust the file size by SIZE bytes. 
The file can be relative to the current directory or 
an absolute path to the file provided.

For complete truncate command options, use the option --help
Source by computingforgeeks.com #
 
PREVIOUS NEXT
Tagged: #trim #log #file #linux
ADD COMMENT
Topic
Name
4+5 =