Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    is it possible to extract gz files out of a single file?


    Because of a misuse of the gzip-command, several files from subfolders where written into one single file:
    gzip -rvc -1 /destination/folder/* > /target/folder/output.gz
    Is it now possible to extract these single gz-files, that were written appendingly bit by bit, e.g. with "sed"? Is there a specific byte sequence like "EOF" in txt-files that can be used for determination if a "new" gz-file begins?

    Thanks in advance,

  2. #2
    Using ghex, I figured out that every gz-file starts with the byte-combination "1F 8B 08 08".
    Several "random" bytes are following, then the original file name is printed as plain text. A gz-file stops with "00".

    What possibilities do I have to get my single gz-files back?
    What would be appropriate sed options (for example: "put everything between two "1F 8B 08 08" in a new file and add "1F 8B 08 08" at the beginning?


  3. #3
    hi viraul,

    i don't think sed is the tool you want because it's text oriented as well as line oriented -- your binary date has neither text nor lines.

    you need a splitting tool for binary data, but i couldn't find any with a quick googling.

    the second post in this thread has some python code to do what you want, but it's not ready to use.

    cheers, kai

  4. $spacer_open
  5. #4
    Just Joined! nigelc's Avatar
    Join Date
    Oct 2006
    Silverwater,NSW Australia

    The gnome file roller

    if you are using GNOME then the file roller might the thing to use.
    It should be to get one file out the archive.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts