Skip to content

Instantly share code, notes, and snippets.

@schnell18
Last active February 24, 2020 04:53
Show Gist options
  • Select an option

  • Save schnell18/512f81d56c201ad186b4c5bc0f65d3ea to your computer and use it in GitHub Desktop.

Select an option

Save schnell18/512f81d56c201ad186b4c5bc0f65d3ea to your computer and use it in GitHub Desktop.
remove virtualbox disk file
GUEST="slave-1"
vboxmanage list hdds \
| sed -e '/./{H;$!d;}' -e 'x;/'"$GUEST"'/!d;' \
| grep UUID | egrep -v Parent | awk '{print $2}' \
| xargs -I{} vboxmanage closemedium disk {} --delete
# vboxmanage list hdds \
# | sed -e '/./{H;$!d;}' -e 'x;/'"$GUEST"'/!d;' \
# | grep UUID | egrep -v Parent | awk '{print $2}' \
# | xargs -I{} echo vboxmanage closemedium disk {} --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment