Skip to content

Commit 3f0d9df

Browse files
+ docker kill all script and short README.
1 parent b181c69 commit 3f0d9df

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.txt
2+
.DS_Store
3+
.vscode/

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
bash_stuffs
1+
Some helpful bash scripts for my personal use
2+
3+
I love JS so I was tempted to find a JS friendly terminal however there is just something so cool about bash scripting!

docker_kill_all.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This script kills all active Docker containers.
2+
# Use with care!
3+
4+
# This strips the Header
5+
docker ps | grep [a-e0-9] > docker.txt
6+
7+
# Just grab container ID
8+
awk '{print $1}' docker.txt > docker_ids.txt
9+
10+
while read DOCKER_ID
11+
do docker kill "$DOCKER_ID"
12+
done < docker_ids.txt
13+
14+
# clean up created resources
15+
rm docker.txt
16+
rm docker_ids.txt
17+
18+
echo "DONE..."
19+
20+
docker ps

0 commit comments

Comments
 (0)