Method to delete logs: 1. Use the "cat /dev/null > log file name" command; 2. Use the ": > log file name" command; 3. Use "> log file name" " command; 4. Use the "echo "" > log file name" command; 5. Use the "echo > log file name" command.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
The database log (alter.log listener.log log.xml) generally cannot be deleted directly. It is best to just clear the content. Here are 5 ways to clear the log:
First type: cat /dev/null > filename
cat /dev/null > 日志文件名
Second type:: > ; filename
: > 日志文件名
##Third type:> filename
> 日志文件名
Fourth: echo "" > filename
echo "" > 日志文件名
The fifth way: echo > filename
echo > 日志文件名
Linux Video Tutorial》
The above is the detailed content of How to delete logs in linux. For more information, please follow other related articles on the PHP Chinese website!