linux query program PID and batch program PID

1. PID batch command

ps aux | grep 关键字 | grep -v  grep | awk '{print $2}'
Replace the keyword with the corresponding program or command

2. PID batch query and kill process

ps aux | grep 关键字| grep -v  grep | awk '{print $2}' | xargs kill -9
Replace the keyword with the corresponding program or command

Guess you like

Origin blog.csdn.net/yjh_SE007/article/details/114238875