Linux Live View tomcat log--less command

Source: Internet
Author: User

View Tomcat logs usually use tail-n or tail-f or grep or VI cat and other commands to see the exception information, but the log is constantly brush screen, tail is dynamic in the change, we often expect from the last line of the Log page forward page to view, so as to find the exception information, The less tool, a tool for distributing display of files or other outputs, is a tool for Linux to view the contents of a file and is extremely powerful

1. Syntax: less parameter file name

2. Parameter Description:

-B < buffer size > Set buffer size
-e When the file display is finished, automatically leave
-F forcing special files to be opened, such as peripheral code, directories, and binaries
-G only flags the last keyword searched
-I ignores case when searching
-m shows a percentage similar to the more command
-N Displays the line number of each line
-o < file name > save less output in the specified file
-Q does not use warning tones
-S displays a row of continuous empty behavior
-S line too long will be out of the partial discard
-X < number > Displays the "tab" key as a specified number space
/string: Search down the function of "string"
String: The ability to search up "string"
N: Repeat the previous search (with/or?). About
N: Reverse repeats the previous search (and/or?) About
b Turn back one page
D Turn back half a page
H Display Help interface
Q Exit less command
U scroll forward Half page
Y Scrolls forward one line
SPACEBAR Scrolls one page
Enter to scroll one line
[PageDown]: Flip one PAGE Down
[PageUp]: Flip one page Up

3. Full Screen navigation

CTRL + F or F-move forward one screen
CTRL + B or B-Move backward one screen
CTRL + D or D-move forward half screen
CTRL + U or U-Move back half screen
4. Single-line navigation
J-Move one line forward
K-Move backward one line
5. Other navigation
G-Move to the last line
G-Move to the first line
Q/zz-Exit less command
6. Other useful commands
V-Edit the current file using the configured editor
H-Show help documentation for less
&pattern-Displays only the lines of the matching pattern, not the entire file
7. Tag Navigation
When you use less to view large files, you can mark them in any one place, and you can navigate to the text location labeled with a specific tag by command:
+ MA-use A to mark the current position of the text
+ ' A-navigate to mark a

8. Search

/: Search with a pattern and navigate to the next matching text
N: Find the next matching text forward
N: Find the previous matched text backwards
? : Searches using a pattern and navigates to the previous matching text
N: Find the next matching text backwards
N: Forward search for previous matched text

PS (This is useful: navigate to the last line of the log file: Shift+g move to the last line)

Linux Live View tomcat log--less command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.