Google Ads

One line Linux command to kill all instances of a program or script running in the background

This one liner command that runs a "kill -9" to all background processes that matched a given search string.



ps -ef | grep [search string] | awk '{print $2}' | xargs kill -9

If you are killing a script, use the script file name as the search string.

You might want to test out with the command below to see if the awk '{print $2}' is passing the PID column to the xargs command. If it is not passing the right data, you need to change the "$2" to select the correct column output from the "ps -ef" command.

Comments

Popular posts from this blog

A Better SKMEI 1418 / 1427 Instructions Manual

A Better SKMEI 1358 Instructions Manual

Jailbreak your Amazon Kindle Keyboard

SKMEI 1358 Review

How to export Tasker's Projects, Profiles, Tasks and Scenes

How to import Tasker projects, profiles, tasks and scenes