Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WARNING THIS WILL HARD DELETE YOUR APPS. YOU COULD LOSE DATA. MAKE SURE YOU KNOW WHAT YOURE DOING!!!!!!!!!!] Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@stochastic-thread

This comment has been minimized.

Copy link

@stochastic-thread stochastic-thread commented Aug 27, 2014

Thanks so much! Great stuff

@java-terminator2

This comment has been minimized.

Copy link

@java-terminator2 java-terminator2 commented Sep 1, 2014

Nice, it works, thx.

@nurrozalina

This comment has been minimized.

Copy link

@nurrozalina nurrozalina commented Sep 4, 2014

thanks

@BrainBuzzer

This comment has been minimized.

Copy link

@BrainBuzzer BrainBuzzer commented Mar 22, 2015

Worked like a charm! Thanks a lot.

@nakamuraagatha

This comment has been minimized.

Copy link

@nakamuraagatha nakamuraagatha commented Jun 23, 2015

thanks

@endows

This comment has been minimized.

Copy link

@endows endows commented Jun 25, 2015

+1

@realbisoye

This comment has been minimized.

Copy link

@realbisoye realbisoye commented Jul 22, 2015

God bless you man

@dlaertius

This comment has been minimized.

Copy link

@dlaertius dlaertius commented Feb 14, 2016

Thanks dude!

@Frikster

This comment has been minimized.

Copy link

@Frikster Frikster commented Feb 29, 2016

So beautiful because it just works just like that. This should be a community QA on SO

@akkijp

This comment has been minimized.

Copy link

@akkijp akkijp commented Apr 10, 2016

+1

@imchikachirag

This comment has been minimized.

Copy link

@imchikachirag imchikachirag commented May 30, 2016

+1

@lymanZerga11

This comment has been minimized.

Copy link

@lymanZerga11 lymanZerga11 commented Jun 17, 2016

Nice. Just a slight modification
for app in $(heroku apps | awk 'NR>1 {print}'); do echo $app; heroku apps:destroy --app $app --confirm $app; done
This would remove the "===My Apps==" section too

@kanso-git

This comment has been minimized.

Copy link

@kanso-git kanso-git commented Jul 10, 2016

indeed Great stuff !! many thanks

@JccSanabria

This comment has been minimized.

Copy link

@JccSanabria JccSanabria commented Jul 13, 2016

Nice!!

@siddharth1001

This comment has been minimized.

Copy link

@siddharth1001 siddharth1001 commented Aug 6, 2016

+1

@santhuuu0007

This comment has been minimized.

Copy link

@santhuuu0007 santhuuu0007 commented Aug 23, 2016

thank you!

@scottyi

This comment has been minimized.

Copy link

@scottyi scottyi commented Sep 17, 2016

Thank you. I love it !

@tagplus5

This comment has been minimized.

Copy link

@tagplus5 tagplus5 commented Sep 25, 2016

thanks

@bbozo

This comment has been minimized.

Copy link

@bbozo bbozo commented Oct 24, 2016

Thanks for this man, it saved my boss hours of work when he wanted to change a certificate :D

@notconfusing

This comment has been minimized.

Copy link

@notconfusing notconfusing commented Nov 1, 2016

+1

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jan 24, 2017

Awesome!!!!!

@muatsoftgit

This comment has been minimized.

Copy link

@muatsoftgit muatsoftgit commented Jan 27, 2017

parabens.. e muito obrigadão

@jorgemurta

This comment has been minimized.

Copy link

@jorgemurta jorgemurta commented Feb 10, 2017

Thanks!

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Feb 10, 2017

awsm!!!

@ugmurthy

This comment has been minimized.

Copy link

@ugmurthy ugmurthy commented Feb 12, 2017

nice - thanks naaman

@markmysourcecode

This comment has been minimized.

Copy link

@markmysourcecode markmysourcecode commented Mar 31, 2017

awesome

@satheeshdragon

This comment has been minimized.

Copy link

@satheeshdragon satheeshdragon commented Apr 6, 2017

it Works Thanks.....

@marieurbina

This comment has been minimized.

Copy link

@marieurbina marieurbina commented Apr 28, 2017

Thank you!

@crj1001

This comment has been minimized.

Copy link

@crj1001 crj1001 commented Jun 18, 2017

I ran this command carelessly thinking it would apply to Heroku apps based off the current directory structure...

Now I've lost a production database... and I must ask, why would anyone EVER need this script? Who on earth has so many throw-away Heroku apps that it is actually too much work for them to run the heroku apps:destroy calls individually, typing in the confirmation every time? Someone mentioned they used it to change a certificate... what?? What kind of workflow requires the destruction of dozens of heroku apps to change a certificate? Why would any workflow need this?

Please prefix this with more of a warning. It looks like I'm not the only one to fall into this google-paste trap.

@kalaverin

This comment has been minimized.

Copy link

@kalaverin kalaverin commented Dec 21, 2018

Please, add unicode support!

@Sekator778

This comment has been minimized.

Copy link

@Sekator778 Sekator778 commented Aug 6, 2020

+1 10q

@NdagiStanley

This comment has been minimized.

Copy link

@NdagiStanley NdagiStanley commented Sep 11, 2020

Awesome, thank you

@naaman

This comment has been minimized.

Copy link
Owner Author

@naaman naaman commented Oct 2, 2020

@crj1001 I'm really sorry that happened. I hope you were able to ultimately restore your stuff :/

I forgot I even made this and only just used it to delete all my personal test apps as I'm leaving Heroku (as my employer, not the product). I updated the subject with a giant warning, but seems like it's still useful so am leaving this around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment