To view logs online, use cat, head, tail, etc

Tail-100f xxxx. log Monitors the latest 100 lines of logs

Tail – 100 – f XXXX. The log | more displays, paging space on the next page, Ctrl + B back

Tail – 100 – f XXXX. The log | grep ‘keyword’

Tail -n 100 Displays the last 100 lines of the log

Free-h Displays the current memory usage

Df XXX Check the disk usage of the target directory

Common commands for troubleshooting problems online

  1. Top Displays the CPU usage of processes to locate faulty processes
  2. Top-hp [pid] Displays the running status of the target process and locates the faulty thread
  3. Printf “%x\n” XXX converts to hexadecimal
  4. Jstack -l [pid] | grep (dar) to look at the process of target problem thread running information, -l print extra lock information
  5. Jstat -gc [pid] [times] If the Thread in question is a GC Thread (VM Thread), use this command to check gc status
  6. Jmap-heap [pid] check heap configuration (jinfo also works)
  7. Jmap-dump :format=b,file= file name [PID] Dumps memory snapshots and analyzes them in combination with MAT