Usually we often need to kill the service process when running the server, so let’s see how to use the linux awk command to kill the process.
As shown above, the system is running the top command, how to use awk kill it?
Of course, when we need to kill a single process, you can run the kill command after viewing the process ID through top, but if you need to batch kill, using the shell command will be much more efficient.
Step 1. View the process ID pid of the top command.
➜ ~ ps -ef | grep top
#ps -ef | awk '/top/'
It is best to use grep -v to exclude the grep command itself.