ps ax | grep java view process Commands " Java "process information, the first column is the process number kill-9 1234 Force kill 1234th Process CD/ Xxx/xxx Enter/xxx/xxx directory cd/data/apache-tomcat-7xxx/logs tail localhost_access-2016-11-28.txt-f Refresh the latest log content per second tail localhost_ Access-2016-11-28.txt-f | grep "202.106.0.20" the log content that contains the word "202.106.0.20" in the log is updated every second grep Error localhost_ Access-2016-11-28.txt View the contents of the log containing error words grep "2016:22:1" Localhost_ Access-2016-11.28.txt | awk ' {print '} ' view list of IP addresses accessed from 22:10 to 19 netstat-nap | grep-v UDP | grep 8080 view 8 080 port connection manifest with UDP row ignored (-v keyword) awk-f ":" ' {print $ {} ' Abc.txt View the second column in the Abc.txt file as a colon delimiter
netstat-nap | grep 8080 to see if port 8080 is occupied, And the information that is occupied
netstat-nap | grep 8080 | grep-v Unix | awk ' {print $4} ' | awk-f ': ' {print $} ' | Sort-nk1 | Uniq-c |sort-rn View all IP addresses that access port 8080 and sort the IP list by number of connections (SORT-NK1 is the IP sort, uniq-c is to merge the same content rows and sort the rows before the number of rows, sort-rn)grep " 2016:0 "Localhost_access_log.2016-11-28.txt | awk ' {print '} ' | Sort-nk1 | uniq-c | Sort-rnps-mp 2633-o thread,tid,time | sort-rn View the PID 2633 process, the CPU occupied by the thread jstack 2633 |grep E18 - A jstack view Java process thread work class is to view the PID 2633 Java process, thread ID E18 (16) Thread of the Java class, you can use printf "%x\n" 3626来 view 3626 16 binary
Linux common Directives--java programmers