Linux common command to view log files

grep command:
find common text
grep -n pattern files -- rule -n means display line number
such as :
grep "null" core-warn.log file contains all the strings



less view the day
ctrl+g is defined to the last line
ctrl+b page by page search up


/string: function to search "string" down
  ? string: function to search up "string"
  n: repeat previous search (related to / or ?)

find day xargs print by line
find *.log | xargs grep "new code:"


1. fullscreen navigation
ctrl + F - Move forward one screen
ctrl + B - move backward one screen
ctrl + D - move half screen forward
ctrl + U - move back half screen

2. Single line navigation
j - move forward one line
k - move backward one line

3. Other navigation
G - move to the last line
g - move to the first line
q / ZZ - exit the less command

ps -e | grep java View all java processes

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326223956&siteId=291194637