mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:33:56 -04:00
This commit refactors all the shell scripts to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. This change ensures that the scripts will run with the system's default Bash interpreter, even if it is not located at the standard `/bin/bash` path.
18 lines
574 B
Bash
18 lines
574 B
Bash
#!/usr/bin/env bash
|
|
|
|
# List all Docker volumes
|
|
echo "Here are all the available Docker volumes:"
|
|
docker volume ls --format '{{.Name}}'
|
|
|
|
# Provide a blank line for better readability
|
|
echo ""
|
|
|
|
# Prompt the user to enter a word associated with the volumes they want to remove
|
|
echo "Enter the keyword associated with the Docker volumes you want to remove:"
|
|
read word
|
|
|
|
# Use the word to filter and remove Docker volumes
|
|
docker volume ls --format '{{.Name}}' | grep "$word" | awk '{print $1}' | xargs -r docker volume rm
|
|
|
|
echo "Volumes associated with '$word' have been removed."
|