Created
November 8, 2021 21:26
-
-
Save ayosec/0a4df059373cbe82ad093005e320c3ae to your computer and use it in GitHub Desktop.
web_publica/spec/fixtures/images/rails.png
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Compute disk usage for every Docker volume. | |
docker volume ls --filter driver=local --format '{{.Name}}\t{{.Mountpoint}}' \ | |
| while IFS=$'\t' read -rs -a ITEM | |
do | |
name=${ITEM[0]} | |
path=${ITEM[1]} | |
if disk=$(du -xsh "$path" 2>&1) | |
then | |
printf '%s\t%s\n' "${disk/$'\t'*/}" "$name" | |
else | |
printf '?\t%s\n' "$name" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment