kill script

1. Start project java script content:
nohup java -jar ./xxx.jar -Dspring.profiles.active = dev >> / the Data / logs / xxxx.log 2> & 1 &
 
 
2.kill out a script for a java process content:
the kill -9 `PS -ef | grep Java | awk '== NR. 1 Print $ {2}'`
or accurately project name directly
kill -9 `ps -ef | grep promotion -test-1.0-SNAPSHOT.jar | awk '== NR. 1 Print $ {2}' `
 
3. explained:
awk 'NR == {print $ 1}. 1'
NR == file. 1 positioned at first row
content print $ 1 is positioned in the first column,
where the symbol` the symbol - is a bond, a state needs to switch to the English
 
4. wherein ps -ef | grep java | awk ' NR == 1 {print $ 2}' in
ps -ef | grep java view the current system is java process,
awk 'NR == Print $ {2}. 1' is found in the second column of the first line of print, the process number and services such formal
------------- ---
Disclaimer: this article is CSDN blogger "PasserBy * _ * 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.

Guess you like

Origin www.cnblogs.com/mc-r/p/12288895.html