Most modern front end tooling offers up all kinds of great features like autosave, hot module reloading, auto refresh. Great tools, I love them.
Sometimes these tools can get you into trouble in browserland. Infinite loops, app hanging after a crash, or serious performance hit, whatever. The point is that you need to kill chrome quick so you can start it back up and keep working.
After trying to use the GUI way of quitting chrome with great failure, I used to always resort to the command line and figure out some kind of ps aux | grep -i chrome
magic sending a kill -9 (sigkill) to one of the billion chrome processes running.
I built this little gem about a year ago with the help of an excellent answer from stackoverflow:
#!/bin/bash
kill -9 $(ps aux | grep -i '[c]hrome' | awk '{print $2}')
Basically, the command finds every process id from the results of the grep search for chrome and applies a kill -9 against it. I have this saved in a file that I can just run whenever I need it.
Leave a Reply