I have a zipped file:
main.zip
And I want to unzip only some folders present in the zipped folder while excluding the .git
pack file.
The folder structure in main.zip
is as follows:
main.zip -> main_folder -> folder1, folder2...
and I want to extract only folder2
from the zipped file, but this folder2
contains the .git
folder with packed files, which I don't need.
So far I have tried :
unzip main.zip "main_folder/folder2/*" -d ~ path/to/some/directory
!(*.git)
will exclude the files ending with .git
, but how do I integrate this in the command above?
The exclude option works!
We just need to provide a path to the files to be excluded!
unzip main.zip "main_folder/folder2/*" -x "main_folder/folder2/*.git/*" -d path/to/some/directory