0

I have a large file in Wondows and neetd to transport it to a Linux server via the linux /tmp folder that has onlz limited capacity.

In order to do so I created a zip with 7zip on my Windows host (where I can not install any additional tools on, due to company resrictions) and split that into 4 files.

largefile.zip.001
largefile.zip.002
largefile.zip.003
largefile.zip.004

extracting the main ~.zip.001 with 7zip on Windows again, seems to pull the data from the other files ~.002-.004. So it somehow recognizez the relation among them.

now how can I achive the same thing on the linux target? gunzip largefile.zip.001 as well as gunzip largefile.zip.00{1,2,3,4} resulted into a unexpected end of file error.

Did I just not identify the right option in man gunzip, or can anybody recommened anything else to do this?


edit: I can neither install anything beyond the mere basics (and the below mentioned 7zip for linux is not one of them) on my rhel server due to lack of sudo privileges.

2 Answers 2

2

Why don't you just use 7zip on Linux?

p7zip packages are in the universe repository in Ubuntu so make sure that you have enabled it using this command:

sudo add-apt-repository universe
sudo apt update

Use the following command to install 7zip support in Ubuntu and Debian based distributions.

sudo apt install p7zip-full p7zip-rar

In the terminal, you can extract a split zip archive file using this command:

7z x largefile.zip.001 -tiso.split -o<output_dir>
2
  • Since p7zip is still at v. 16.02, AFAIK, and Windows 7-Zip, on which p7zip is based, is at v. 24.06, you might want to download the latest from 7-zip.org and run it under wine, which works well on my PC's. However, that will require using wine as a prefix when using 7-Zip in terminal. Commented Jun 7 at 16:05
  • thx for the pointer and sorry I for being not specific enough (habe eddaed this info above now) ... I can neither install anything out of the usual on my server (due to other company restrictions), so 7zip is out of the game.
    – vrms
    Commented Jun 9 at 12:01
0

that is how I mangaged to do this.

on my Windows local laptop with git bash

  1. split the original unzipped file with
    split -b 2500m -a 2 -d large_file.sql large_file.sql-

  2. compress all of them with ...

    for i in $(seq 0 7) ; do gzip large_file.sql-0"${i}" ; done

  3. manoever those over to my rhel server server (using WinSCP)

On my rhel server

  1. extract them there with ...
    for i in $(seq 0 7) ; do echo gunzip large_file.sql-0${i}.gz ; done
  2. put then together into one single file again
    cat large_file.sql-0{0,1,2,3,4,5,6,7} > /path/to/large_file.sql

I am not 1000% certain, whether the cat (#5) part would have worked with a binary file rather then text, but I think it should.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .