Skip to content

Instantly share code, notes, and snippets.

@mojocn
Created March 5, 2018 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mojocn/1f54504f878c149ad2c3057c6b90efc0 to your computer and use it in GitHub Desktop.
Save mojocn/1f54504f878c149ad2c3057c6b90efc0 to your computer and use it in GitHub Desktop.
how to add process by name in bash
#!/bin/bash
ps -efww|grep -w './start.sh'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Mqtt_msg_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Rds_msg_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Event_notice_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Offline'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py dahua'|grep -v grep|cut -c 9-15|xargs kill -9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment