Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 220

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report