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

How does the Linux system view tomcat logs

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you how the Linux system views the tomcat log, the content is easy to understand, clear, hope to help you solve the doubt, the following let the editor to take you to study and learn "Linux system how to view the tomcat log" this article.

The command is: tail-f catalina.out

The purpose of the tail command is to write a file to standard output from a specified point. Using the-f option of the tail command, you can easily view the changing log file. Tail-f filename will display the last content of the filename on the screen and not only refresh it, so that you can see the latest file contents.

Standard syntax tail [- f] [- c Number |-n Number |-m Number |-b Number |-k Number] [File]

To display the lines tail [- r] [- n Number] [File] in reverse order

The describe tail command writes the file specified by the File parameter to standard output from the specified point. If no file is specified, standard input is used (that is, it shows you typing on the keyboard). The Number variable specifies how many cells are written to standard output. The value of the Number variable can be a positive or negative integer. If the value is preceded by a + (plus sign), the file is written to standard output starting with the number of cells specified at the beginning of the file. If the value is preceded by a-(minus sign), the file is written to standard output starting with the number of cells specified at the end of the file. If the value is not preceded by a + (plus sign) or-(minus sign), the file is read from the unit number specified at the end of the file.

The type of unit used by the Number variable to determine the starting point of the count is determined by the-b,-c,-k,-m, and-n flags. If no one of these flags is specified, the tail command reads the last ten lines of the specified file and writes it to standard output. This is the same as typing-n 10 on the command line.

The-m flag provides consistent results in single-byte and double-byte character environments. The-c flag should be used with caution when the input is a text file that contains multi-byte characters, as the resulting output may not start at the character boundary.

Mark

-b Number reads the specified file from the 512-byte block location represented by the Number variable.

-c Number reads the specified file from the byte location represented by the Number variable.

-f if the input file is a regular file or if the File parameter specifies FIFO, the tail command does not terminate after copying the last specified unit of the input file, but continues to read and copy additional units from the input file (when those units are available). If no File parameter is specified and the standard input is a pipe, the-f flag is ignored. The tail-f command can be used to monitor the growth of files being written by another process.

-k Number reads the specified file from the location of the 1KB block represented by the Number variable.

-m Number reads the specified file from the multibyte character position represented by the Number variable. Use this flag to provide consistent results in single-byte and double-byte character code set environments.

-n Number reads the specified file from the line location represented by the Number variable.

-r displays the output in reverse order from the end of the file. The default value of the-r flag is to print the entire file in reverse order. If the file is larger than 20480 bytes, the-r flag displays only the last 20480 bytes.

The-r flag is valid only with the-n flag. Otherwise, it will be ignored.

Exit status this command returns the following exit values:

0 completed successfully.

An error occurred in > 0.

To display the last ten lines of the notes file, type:

Tail notes to specify the number of lines to read from the end of the notes file, enter: tail-n 20 notes to start at the 200th byte, one page at a time to display the notes file, enter: tail-c + 200 notes | pg to track the growth of the file, enter: tail-f accounts this shows the last ten lines of the accounts file. The tail command continues to display the lines added to the accounts file. The display continues until you press the Ctrl-C key order to stop. File

/ usr/bin/tail contains the tail command.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

The above is about "how the Linux system views tomcat logs". If this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.

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: 0

*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

Development

Wechat

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

12
Report