Skip to content

Instantly share code, notes, and snippets.

@koen-db
Created August 28, 2024 19:07
Show Gist options
  • Save koen-db/378335ad966d1a5c8e6c9e32e9d38483 to your computer and use it in GitHub Desktop.
Save koen-db/378335ad966d1a5c8e6c9e32e9d38483 to your computer and use it in GitHub Desktop.
Find proxmox VM's and do something
for vmid in $(qm list | grep vm | grep stopped | grep -v 110 | awk '{print $1}'); do echo $vmid; done
for vmid in $(qm list | grep vm | grep stopped | grep -v 110 | awk '{print $1}'); do qm shutdown $vmid; done
for vmid in $(qm list | grep vm | grep stopped | grep -v 110 | awk '{print $1}'); do qm stop $vmid; done
- DANGER WILL ROBINSON! -
for vmid in $(qm list | grep vm | grep stopped | grep -v 110 | awk '{print $1}'); do qm destroy $vmid; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment