log file name" command; 2. Use the ": > log file name" command; 3. Use the "> log file name" command; 4. Use "echo " " > Log file name" command; 5. Use the "echo > Log file name" command."/> log file name" command; 2. Use the ": > log file name" command; 3. Use the "> log file name" command; 4. Use "echo " " > Log file name" command; 5. Use the "echo > Log file name" command.">

How to delete logs in linux

青灯夜游
青灯夜游Original
2021-12-21 15:12:1325878browse

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.

How to delete logs in linux

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 > 日志文件名

The above 1/2/3 methods can clear the file, and the file The size is 0

and the following 4/5 method results in a "\0" in the text. After clearing, the file size is 1

Related recommendations: "

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn