Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the ways for Linux not to restart Tomcat to empty catalina.out logs?

Shulou Source: shulou.com Published: 2022-06-01 19:06:59 10月01日 Update

The main content of this article is to explain "what are the methods of Linux not restarting Tomcat to empty catalina.out logs", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the methods of Linux not restarting Tomcat to empty the catalina.out log?"

The redirect method clears the file

Du-h catalina.out view file size > catalina.out redirect empty file du-h catalina.out view file size

True command redirects emptying files

The du-h catalina.outtrue > catalina.outtrue command redirects to empty the file du-h catalina.out

Cat/cp/dd command and / dev/null device to empty the file

The df-hdu-h catalina.outcp / dev/null > catalina.out command clears the file cp:overwrite 'catalina.out'? Ydu-h catalina.outdf-hdu-h catalina.outcat / dev/null > catalina.out command clear file df-hdf-hdu-h catalina.outdd if=/dev/null of= catalina.out command clear file du-h catalina.out

The echo command empties the file

Echo-n "> catalina.out plus"-n "parameter, default will be"\ n ", that is, carriage return

The truncate command empties the file

Truncate-s 0 catalina.out-s parameter is to set the size of the file. If you empty the file, set it to 0. I believe you have a deeper understanding of "Linux does not restart Tomcat to empty the catalina.out log". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Files commands methods logs size content parameters learning practical deeper that is interest practicality reality situation simple operation more friends websites devices Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple MariaDB vpn Redmi