The other day I was collecting some logs from a remote server and unthinkingly gzipped the files into a single file, rather than adding the directory to a tarball. I can manually separate out some of the log files, but some of them were already gzipped. So the original files look like:
ex_access.log
ex_access.log.1.gz
ex_access.log.2.gz
ex_debug.log
ex_debug.log.1.gz
ex_debug.log.2.gz
ex_update.log
ex_update.log.1.gz
ex_update.log.2.gz
and are compressed into exlogs.gz, which upon decompression is, as you would expect, one file with all the original files concatenated. Is there a way to separate out the original gz files so that they can be decompressed normally instead of printing out the binary:
^_<8B>^H^H<9B>C<E8>a^@
^Cex_access.log.1^@<C4><FD><U+076E>-Kr<9D> <DE><F7>S<9C>^W<E8><CE><F0><FF><88>y[<D5><EA>+<A1>^EHuU<A8>^K<B6><94><AA>L4E^R̤^Z^B<EA><E1><DB>}<AE>̳<B6><D6>I<C6><F8><9C><DB><C6>
<F1>@G`<E6><D6><FE><E0>3<C2><C3>ٰ̆|<E4><FC><BB>#<FD><EE><B8>~9<EA>+<A7>W+<FF><FB><FF><F6><9F><FE><97><FF><E3><97><FF><FD>^Z<E3><FF><F8><E5><FF><FE><CB><C7><FF>Iy<FC>?<8E><F9>?<F3>?<EF><B5><F7><F9><BF><FF>ß<FF>
[etc]
Yes, I could just collect the logs again (since I did have the sense to leave the originals intact), but getting approval for access to the server is a pain and I'd like to avoid it if at all possible.
Edit: the command I used is
gzip -c ex_* > exlogs.gz
exlogs.gz
file that you say contains all the files? – Kusalananda Jan 25 '22 at 18:12binwalk
might be worth a try – frostschutz Jan 25 '22 at 18:15