Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, Because of a misuse of the gzip-command, several files from subfolders where written into one single file: Code: gzip -rvc -1 /destination/folder/* > /target/folder/output.gz Is it now possible to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2

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


    Hi,

    Because of a misuse of the gzip-command, several files from subfolders where written into one single file:
    Code:
    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,
    viraul

  2. #2
    Just Joined!
    Join Date
    Aug 2008
    Posts
    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?

    Thanks!

  3. #3
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    164
    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
    $spacer_close
  5. #4
    Just Joined! nigelc's Avatar
    Join Date
    Oct 2006
    Location
    Silverwater,NSW Australia
    Posts
    32

    The gnome file roller

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

    Cheers

Posting Permissions

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