

- #Bash zip folder zip file#
- #Bash zip folder archive#
- #Bash zip folder windows 10#
- #Bash zip folder Pc#
#Bash zip folder zip file#
If the zip file is of web origin, there's also some added overhead because it creates a Zone.Identifier alternate data stream for each file it extracts, but that shouldn't take very long.Īll of the initially tested speeds were on the same Parent OS and tested on the same NTFS SSD. I could try using ProcMon to verify it but I stopped using Windows Explorer for zip files long ago. And optimizing their zip integration probably isn't high on their priority list. It's the kind of mistake a lot of developers would make, and which VFS-style interfaces (presenting the zip as a simulated filesystem to make Explorer integration easier) make hard to avoid. zip integration is a bit over-abstracted such that instead of extracting all the files in one pass, it extracts the files one-by-one passing just the filename, and the extraction function has to reopen and re-scan the zip file each time to locate the file's zip entry by name, making the time spent scanning zip directory entries proportional to the square of the number of files. My long-held assumption is that Windows Explorer's.
#Bash zip folder windows 10#
Any ideas why there is such a big difference?Īll from the same Windows 10 low spec laptop on SSD:ġ7 Seconds/WSL2 Bash Shell SECONDS=0 unzip -qq takeout-20211129T163945Z-001.zip echo "$SECONDS seconds"ģ3 Seconds/Windows Powershell Measure-Command Ģ70 seconds/Windows Explorer GUI Right click "takeout-20211129T163945Z-001.zip" select "Extract All." I just did some tests in WSL2 and bash beats Windows here on all 3 tested methods.
#Bash zip folder Pc#
I remember extracting the same file on my personal pc running Debian and it seemed instant. zip file from Windows Explorer and to my surprise it took 4 minutes and 30 seconds. zip compared to Windows? Also, why is Windows Explorer GUI extract so far behind both Bash and Powershell? I just extracted this 53MB. Why is bash so much faster at extracting. Do you think the Explorer GUI is slowed by trying to render all of the filenames as it is extracting them? maxdepth 1 -type d -exec zip archive.Native Debian 11 on old sata3 ssd time unzip -qq takeout-20211129T163945Z-001.zipĪll of the rest below here were all using NTFS including WSL2 Debian 11 all on the same machine.Įdit: AV is disabled and the zip file has about 7k small files in it. If you want to zip folders in the current working directory, you would run the following command $ find. You have to link it to the “exec” option in order to execute the “zip” command that creates an archive. zipĪlternatively, if you are not sure where you stored your zip files before, you can search for files using the find command $ find / -name *.zip 2> /dev/null Zip Folder using findĪnother great way of creating a zip file for your folders is to use the “find” command on Linux.
#Bash zip folder archive#
In order to check if your zip file was created, you can run the “ls” command and look for your archive file. In order to achieve that, you would run the following command $ zip -r temp.zip Documents

įor example, let’s say that you want to archive a folder named “Documents” in a zip file named “temp.zip”. You can also specify multiple folders if you want to have multiple directories compressed in your zip file. The easiest way to zip a folder on Linux is to use the “zip” command with the “-r” option and specify the file of your archive as well as the folders to be added to your zip file.
