Commands for killing/stopping the process

Commands I learned while trying to make supervisord work on my CentOS machine.

Before this i knew only grep and ps command with aux parameters.

What I did was:

ps aux | grep supervisor

see the pid of process and then

kill 23467

More interesting way:

kill -HUP `pgrep superv`

Explanation:

kill -HUP

sends hang-up signal to the selected process.

HUP usually restarts the process.

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.

And then this command:

pkill process_name

to kill based on process name or send any signal

pkill -HUP superv

More info on this blog post

Author

I plan to write more articles about common laravel components. If you are interested let’s stay in touch.
comments powered by Disqus