Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Mac OS X 10.7.1 on a Macbook Core 2 Duo.
What's the fastest way of draining the battery without crashing the system and preferable by using some sort of a script?

share|improve this question
Convert videos. Lots of them. In HD. – Soumya Aug 21 '11 at 6:54
Run SETI@home (or other BOINC projects) on it: – Randolf Richardson Aug 21 '11 at 6:57
@Randolf is this similiar to Folding@home? – Tyilo Aug 21 '11 at 7:00
@Tyilo: If that's part of the BOINC system, then "yes, it is." I only participate in the SETI project (which I believe is what inspired so many of these distributed computing projects to start). – Randolf Richardson Aug 21 '11 at 7:02
@Randolf SETI looks for alien signals by doing analysis of information from radio telescopes but the technology is similar to that of Folding@Home. – Col Aug 21 '11 at 8:10
up vote 15 down vote accepted

Keeping your CPU's busy can be done with a script. Just run the following in 2 consoles:

yes > /dev/null

If you have more than 2 CPU's you need to run it in more consoles. Another option is to write a slightly more complicated script that uses multiprocessing but this is the simplest thing that will max out your CPUs.

share|improve this answer
The "yes" command should be upgraded to a multi-threaded version. ;-P – Randolf Richardson Aug 21 '11 at 23:03
This certainly maxes out the processor in a pretty quick and easy script. – alimack Sep 1 '11 at 13:16
IF you have two cpu's use yes > /dev/null & yes > /dev/null – Tyilo Jan 9 '12 at 17:11
This worked under Linux too! – slm Jan 9 '12 at 18:57
This is great, thanks! I also am taking the opportunity to rebuild by spotlight index as well as scan for viruses. Combined I've gone from like 6-hours-to-discharge to just over 2. – Bane Aug 5 '14 at 2:05

If you can run utilities that cause moving parts to work, then that should drain a the battery fairly quickly. Writing CDs or DVDs, copying large amounts of data (such as with @Soumya92's suggestion in a Comment [to your Question] to convert videos which would also consume processing power), or even running a scan on your hard drive for bad sectors (which would require reading every sector) are some things that come to mind.

For using a script, you'd probably have to write your own. It could run in an endless loop copying large amounts of files to a RAM disk (that way when the power goes out, you won't have a corrupt disk to deal with since RAM disks don't matter), a partition used for temporary file storage, or a USB memory stick (or external hard drive).

Here's a more complete list of ideas:

  • Write CDs or DVDs
  • Copy large amounts of data
  • Convert videos (@Soumya92's suggestion in a Comment to the original Question)
  • Run a hard drive scan for bad sectors
  • Write a custom script that copies data to temporary storage, repeatedly
  • Turn up sound, brightness, and other features
  • Plug in a USB cellular phone charger (and charge a phone that's powered on)
  • Plug in a USB reading lamp and turn the light on
  • Plug in a USB fan and run it
  • Plug in an iPod (or similar device) and play music or videos at full volume and brightness
  • Download torrents of public domain movies or music (assuming you can find some)
  • Play some online games (especially the 3D kind that require more graphics processing power)
  • Backup your entire hard drive to an external hard drive
  • Install BOINC and run SETI@home (or other BOINC projects):
  • Set up a Virtual PC, install Unix or Linux, and compile FFMPEG, VLC, OpenJDK 7, and TomCat (plus, anything else you'd like to experiment with)
  • Engage in video chat with your friends
  • Encrypt important data using the most complicated and most secure algorithms you can find

Whatever can bog down your system with lots of disk I/O (which also includes CD and DVD activity) and high CPU utilization should do the trick. Additional power drain from USB devices that don't have their own power sources can help too.

share|improve this answer

In general, use 100% of CPU usage, turn up the brightness, don't let it go to sleep.

share|improve this answer
Whilst keeping the CPU busy is easily achieved and will definitely drain battery, keeping the screen on at it's brightest setting as you mentioned will always be the biggest power consumer, +1. – Jack Sep 28 '15 at 12:29
while [ true ]
dd if=/dev/zero of=/junk bs=1024 count=5120000
rm -f /junk

this will keep writing 5gb to a file called /junk and then delete it

share|improve this answer
Writing data to disk shortens its lifespan, so I would advise against doing this. – suweller Jul 11 '12 at 15:11

Do this in terminal:

while [ true ]
  dd if=/dev/zero of=/junk bs=1024 count=5120000
  rm -f /junk

This should shorten your battery life. Do not try to do this in two tabs, otherwise your computer will shut down and you will have to take it in for service.

share|improve this answer
Can you elaborate ? – bertieb Sep 28 '15 at 12:35
Excuse my ignorance - how is it different from looping a same video on a media player.... – Prasanna Sep 28 '15 at 12:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.