kill all processes used by a specific application or user

You can translate the content of this page by selecting a language in the select box.

AI Unraveled: Demystifying Frequently Asked Questions on Artificial Intelligence

Shell script to kill all processes used by a specific application or user

On Linux servers, when applications are not correctly shut down, there are still some processes running and starting the application with those processes still running can result in the application not starting correctly or not functioning properly. It is imperative to always kill all lingering processes after shutting down an application.

Amplify Your Brand's Exposure with the AI Unraveled Podcast - Elevate Your Sales Today! [200K downloads per Month]

If the list of  the lingering processes is long, it can be a pain to go through them one by one.

This shell script will kill them all in one command.

#NOTE: Please don’t try this unless you have tried every thing else and there is no way else left.
# Run it as root
# For this example, you are running a oracle application using user account oracle.
# We assume that , there are not other application running under the account oracle.
kill -9 `ps -ef | grep oracle  | grep -v grep | awk ‘{print $2}’`
error: Content is protected !!