Quick tips to kill an application on Raspberry Pi

When you are running and testing a web server (e.g cherrypy) on Raspberry Pi, and there is an error in your codes. You did not shutdown the server nor kill the application properly. You fixed the error and reload it. Tadaa! You get an error saying that the port is not freed and you do not know what to do! Solutions on the internet say “find the app Process ID (PID)”… but how exactly should you find it out of no where??

Or you are testing your new raspberry Pi camera. Opps it hangs and it is on forever. You cannot turn it off, you cannot use it for another test. How to kill it??

Try this:

pgrep the-app-name
E.g. pgrep python

This will return you the PID number (4 digits) of that app (e.g 4908)
Then type:
kill 4908

Raspberry Pi is now good to go for another test.šŸ˜‰

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s