Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

Fun with Unix

What do you do if you have a tarball (Windows users: "zip file") that's taking up most a lot of the filesystem ("disk space"), not leaving you enough room to uncompress it?


-- cut the archive file into bite-sized chunks (with, say, dd(1)), starting at the back of the file, and calling truncate on the original file as you go backwards. Or maybe you have enough space, so you don't need to truncate. Easier. Then just delete the full-sized archive at the end of your chunking.

-- pipe all the chunks (in foward order!) into tar -zxvf - ("uncompress"), unlinking each chunk as you move on to the next.

Sure, this doens't let you resume later if there's a failure, since you killed your original chunks. But I'm assuming you can get the archive back if you need it.
Tags: hacks, tech, unix

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.