Original URL: Linux command--end the process according to the java application name_IT Knives Out Blog-CSDN Blog
Introduction
This article introduces the Linux command to end (kill) the process based on the application name of jps -l.
The method is: jps + grep + kill
Order
jps -l | grep procedure_name | grep -v grep | awk '{print $1}' | xargs kill
procedure_name is the process name.
analyze
- jps -l
- List all java processes (with application name)
- grep procedure_name
- Find the process with the specified process name
- grep -v grep
- Do not display processes with grep (that is, the process corresponding to this grep command)
- awk '{print $1}'
- Filter out process ID
- xargs kill
- Kill specified process