commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Overwrite all sectors with zeros in one pass with ETA and speed status. If you wish to do more passes, encapsulate the line in a for loop (7 pass example):
for f in `seq 1 7`; do pv -s `fdisk -l /dev/sdX|grep "Disk /"|cut -d' ' -f5` /dev/zero >/dev/sdX ; done
Note: Substitute /dev/sdX with the correct drive you wish to erase. Also, you may have to be root to execute the command.
There are 9 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.