Answers for "linux clear log"

1

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
Posted by: Guest on February-04-2021
0

clear log file space linux

find /var/log -type f -delete
Posted by: Guest on July-07-2020
0

clear log file space linux

find /var/log -type f -regex ".*.gz$"
find /var/log -type f -regex ".*.[0-9]$"
Posted by: Guest on July-07-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language