We, the members of this hackathon team, do not encourage or endorse the use of our code in any system that might hold important data. This code was written as a joke, but it is functional and does actually delete half of any system that runs out of storage. Use at your own risk.


It is hard to attribute such a divine, ineffable idea to one specific earthly source, but if you really pressed us, we'd have to say that we took some inspiration from the Avengers movies (specifically, Infinity War and Endgame). In these films, Thanos appears as the primary antagonist intent on using the Infinity Stones to "snap" half of the universe's population out of existence at random. We all thought that this was an elegant, sustainable solution to a much smaller problem with absolutely no problems whatsoever. None at all.

What it does

Simply put, when your hard drive is more than 75% full, ThanOS will indiscriminately delete half of your files at random. ThanOS launches at boot, has a minimal CPU footprint, is written entirely in bash, and is difficult to disable, making it ideal for managed Linux distributions.

How we built it

According to our lead developer, he "...collected the six infinity bash scripts and combined them into one, wielding the power of the multiverse at [his] fingertips." In reality, we explored a number of other solutions before settling on the current deployment: an automated background script written in bash.

Challenges we ran into

While we're not looking forwards to a letter from Disney's legions of lawyers, the technical aspects of this project relied on a strong understanding of Linux and bash. We spent several hours investigating different possible deployments, including native integration into a Linux distribution, or possibly creating a custom GCP image that could be used to spin up VMs that are incredibly respectful of the cost of cloud storage, always keeping themselves well under their maximum capacity. Ultimately, none of these panned out, so we made several pivots to ensure that we kept the spirit of the idea alive while still delivering something by the hackathon deadline.

Accomplishments that we're proud of

It works! For such a silly concept, actually executing on our (outlandish) vision and being able to spend time on something we could all laugh at was a welcome break from the real-world apocalypses knocking on our doors. The (admittedly somewhat impractical) code works, the art is silly, and we all had a good time in the process.

What we learned

We should never have risked allowing the script to go for the head (read: delete system files).

What's next for ThanOS

We finally rest and watch the sun rise on a grateful PennApps.

Built With

+ 22 more
Share this project:


posted an update

We've received an inquiry by a judge as to our use of the pseudorandom $RANDOM function in our bash script, as opposed to true RNG.

Practically speaking, this was the best cross-platform solution we found for reliably running our script across our Linux and Mac test environments (and was the third or fourth function of that type we tested).

Thematically speaking, we feel that this was close enough to Thanos' stated goal of reducing the galactic population by half, especially when we have no statistical insight (especially offered by anything close to a reliable narrator) as to how Thanos' egalitarian genocide would have been carried out in practice (Is the snap's 50/50 RNG localized to each planet? Each nation? Each species? And is it, as Thanos implies, truly random? Without additional canonical materials, we can't be sure!).

Log in or sign up for Devpost to join the conversation.