Skip to content

Commit

Permalink
added killAllProcesses bash function to ubuntu dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Nov 25, 2019
1 parent 9857d68 commit 897c30d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ubuntu/Readme.md
Expand Up @@ -102,6 +102,21 @@

[[Read more](https://en.wikipedia.org/wiki/Unix_shell)]

1. Kill all processes that match the name
```bash
# Drop this in your ~/.bashrc or ~/.zshrc file
# Use as: killAllProcesses chrome
# where 'chrome' is the name of the process
#
# To get the name of the process run: ps -A
function killAllProcesses(){
for f in $(pgrep "$1");
do
echo "💀 Killing PID $f"
kill -9 $f;
done
}
```
1. Check the name of your default os
```bash
echo $OSTYPE
Expand Down

0 comments on commit 897c30d

Please sign in to comment.