Kelly Martin changelog.com/posts

The Feds are here! (or, aliasing for those tight spots)

Aliasing commands is one of the most useful tools for automating important, difficult-to-remember tasks.

Here’s one I keep around for the right moment for my Mac:

alias feds-are-here='diskutil list | grep /dev | sort -r | \
                     xargs diskutil secureErase 1'

Or if I’m at my Linux box:

alias feds-are-here="fdisk -l | grep 'Disk /' | sort -r | \ 
                     awk '{print substr($2, 0, length($2))}' | \
                     xargs -I % dd if=/dev/urandom of=% bs=1M"

That way when I’m in a tight spot, I don’t have to remember which order to securely erase my drives. This command takes care of it for me.

Just a word of caution: it doesn’t ask first before starting the destruction.

Vote this up on Hacker News.


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00