36

I download 1 large folder 10 GB from Google Drive but it becomes several zipped files. I would like to combine the downloaded split zipped files from Google Drive with its original folder and sub-folder structure. The parents' folder contains 4 sub-folders, which each of the sub-folder contains 24 .mp4 video files.

Please advise

Nguyen
  • 379
  • 1
  • 3
  • 4
  • You need to give more information about the file. Is it compressed? What kind of file is it? When you say "combine it with original structure," what exactly do you mean? Please be more specific so that someone can give you a constructive answer. – Adam Johnston Mar 25 '20 at 04:42
  • Have you found a solution? – vinni Jul 03 '20 at 16:19

2 Answers2

91

Here's a solution for Mac or Linux command line.

mkdir combined
unzip '*.zip' -d combined

Or, for Windows Powershell, you can try (courtesy of source):

Get-ChildItem 'path to folder' -Filter *.zip | Expand-Archive -DestinationPath 'path to extract' -Force
klondike923
  • 919
  • 5
  • 3
  • 2
    Linux solution worked for me on windows using the official ubuntu subsystem, but my CPU usage remained low, I think this suggests that the subsystem isn't able to take full advantage of the CPU, making it inefficient for this task, but still doable! – Issung Nov 07 '20 at 06:54
  • @Joel it might have more to do with disk speed than CPU, it didn't make particularly good use of my CPU on Linux either. – jrh Jan 18 '21 at 18:18
  • 1
    This is an efficient answer, but on macOS 11.2.3, this unfortunately fails for zipped file names with some non-ASCII characters (like û) . The solution of chanduthedev does work, when opening the resulting single ZIP file _directly through the Finder_. I couldn't find a way of having the `unzip` command to work. – Eric O. Lebigot Apr 12 '21 at 20:09
  • I came up with this too earlier, but then found this! Don't you need the -n flag to not overwrite files? If all files unique from Google, this is pointless, but not sure how unzip handles folders. Would it replace the folder? Haven't had time to try. – Jackpile Dec 17 '21 at 21:10
  • Thank you for Windows Powershell, it works, this should be an answer. – Marie Nov 26 '22 at 13:08
  • 1
    to avoid unzip "Illegal byte sequence": ditto -V -x -k *.zip combined – Joseph Jan 05 '23 at 16:51
  • ditto command mentioned by @Joseph is working for me on Mac. – JeanCarlos Chavarria May 30 '23 at 01:38
3

Using cat command, it is very simple and easy to combine all split parts into a single zip file.

cat file_zip.001 >file.zip

cat file_zip.002 >>file.zip

cat file_zip.003 >>file.zip

You can unzip file.zip like normal zip file.

chanduthedev
  • 356
  • 2
  • 9
  • 3
    Or more simply (assuming that files are named alphabetically and that the shell expands them alphabetically too): `cat file_zip.* > file.zip`. An advantage of this solution is that the builtin macOS Finder unzipper typically correctly handles accented zipped file names. – Eric O. Lebigot Apr 12 '21 at 20:10
  • 2
    This doesn't work for google drive split zips... they are not split in words, each of them is a stand alone zip. – Ray Foss Jul 19 '21 at 03:26
  • @EricOLebigot This command would work if the file/folder is zip & split using something like: `zip -s 24m -r zz.zip foldername` – iaL Sep 23 '22 at 17:55