Questions tagged [zip]
For questions about ZIP files and associated tools. ZIP is a file format used for data compression and archiving.
548
questions
1
vote
1
answer
32
views
See if any of a number of zip files contains any of the original files in a directory structure
I have a pretty hard problem here.
I have a photo library with a lot of photos in it in various folders.
I then started using Google Photos for my photos, I put those originals into Google Photos, and ...
0
votes
2
answers
63
views
How to have an archive with full paths, BUT without creating a tarbomb?
I want to create an archive file that preserves the absolute path information of the originals, but I have not been able to find a way to do this that does not result in a tarbomb?
For concreteness, ...
0
votes
1
answer
40
views
How to iterate through directories of zip files and locate & append files without a .zip extension
I have a directory of sub-directories that contain sub-directories which are supposed to be compressed archive files. Structure is illustrated below
ParentDirectory
|-SubDirectoryA
|-File Mr X.zip
|-...
0
votes
1
answer
25
views
Iterate sub-directories and zip files with same prefix and remove original files after compression
I have the current code:
for fname in *.*; do
prefix=${fname%.*}
[ ! -f "$fname" ] || [ -f "$prefix.zip" ] && continue
zip "$prefix" "$prefix&...
0
votes
1
answer
33
views
zip command seems to not doing its job correctly
I use a USB drive to save/load some docker images to/from a USB flash disk and distribute it amongst the team.
This is my script to save one of the images:
echo "Saving some/image ..."
...
0
votes
1
answer
112
views
Creating a zip file incrementally
I currently have a large directory on S3 (>100GB). I want to create a zip archive of this directory.
Currently, I download the contents of the directory and create a scratch (temp) directory on the ...
0
votes
2
answers
56
views
How to Find and zip all my pdf files of all subdirectories
I'm trying to find and zip all my pdf files.
find works fine:
find -iname "*.pdf"
I want to zip everything that is printed into 1 file.
Thank you for your time.
1
vote
1
answer
67
views
Create a zip archive with Ark and use the method Store?
How can I create a zip archive using the graphical interface of Ark and use "Store" instead of "Deflate" for compression?
UPDATE
Apparently, there are significant differences ...
1
vote
1
answer
82
views
Listing the contents of an archive non-recursively using `zipinfo`
Is there a flag that I can pass to the zipinfo command to list the contents of an archive non-recursively?
For example, if the target archive contains three directories, which in turn contain five ...
0
votes
0
answers
62
views
How do I change the default file manager in Cinnamon Arch?
I'm a new Arch user, and I have tried to take a few looks around for an answer to this, but most responses point vaguely to the solution rather than anything that goes step-by-step for this. Even on ...
13
votes
1
answer
1k
views
Why are directories sometimes listed explicitly in ZIP files?
While building an application that extracts ZIP files I noticed that sometimes ZIP files explicitly contain entries for the directories and sometimes not. Given for example the following structure
...
0
votes
0
answers
29
views
zip filesync update permissions and owner
I am using the zip -FS command to sync a directory with a zip archive. While it works quite well in general, I have noticed, that this doesn't update changes in file permission or owner.
Is there a ...
0
votes
0
answers
23
views
unpack and gzip all individual files directly?
i am trying to find a way to unzip lots of files and then gzip the content individually.
so i have houndred thousands of zips here wich contain a number of *.xyz files.
since my disk space is not ...
7
votes
3
answers
2k
views
Read file content in a zip file without unzipping?
Given a zip file zipfile.zip, we know that it contains a file called text.txt.
Is there a way to read the content of text.txt without unzipping zipfile.zip?
0
votes
1
answer
133
views
Pipe zip & unzip together to form the identity function
Update: On closer inspection of the man page it appears that it is not yet supported by unzip to read archives from standard input. The man page refers the user to funzip instead. I guess this makes ...
0
votes
1
answer
155
views
Is possible compress and uncompress a file with a password but considering an expiration date too?
In Linux about compression files can be accomplished with the tar and zip/unzip commands, perhaps more. I know that is possible establish a password protection for security reasons.
The question is:
...
-2
votes
1
answer
46
views
How to install Apache and DNSmasq tools, without Terminal
How can I install apache server and dnsmasq without using a terminal? Just downloading ZIP files and manually configuring them. The easiest is to install the installation tools from the command line, ...
4
votes
1
answer
172
views
How do I create a zip that preserves unicode character composition on linux?
I'm on Debian. I have a file called Sóanr.jpg. According to https://emojidissector.com/, this is made of the following code points:
S 0053 LATIN CAPITAL LETTER S
o 006F LATIN SMALL LETTER O
...
0
votes
1
answer
66
views
Zip files contained in a file over a loop
I have a file with X paths to files I want to zip.
I have this loop:
while read -r path; do
zip -u "$zip_file" "$path"
done <"$paths_file"
I have this error:
zip ...
0
votes
1
answer
84
views
Extract all content from multiple zip files contained in compressed tar archive
I receive a tar.gz file which packages multiple zip files - reproduced below:
$ rm -Rf zipdir; mkdir zipdir; echo foo > zipdir/a.txt; echo bar > zipdir/b.txt; cd zipdir; zip -m a.zip a.txt ; zip ...
1
vote
1
answer
111
views
Can a quiet zip still show warnings for missing files?
I often use zip with the -q flag (actually -r -q) for a quiet operation at the command line. Routinely I also then unzip each file I create, and check by eye whether the contents look correct; before ...
3
votes
1
answer
1k
views
Difference between ar, tar, gzip, zip and when should I decide to choose which one?
I had a use case where I needed to pack a bunch of files into one. And all above commands does the same. I know gzip compresses my files but lets say space is not at all an issue for me then in that ...
12
votes
3
answers
5k
views
If the maximum size of a ZIP archive is 4 GB then how can I have a 33 GB ZIP archive?
I have this:
-rw-r--r-- 1 user user 36166999908 Jan 29 2022 tmp.archive.part1.zip
-rw-r--r-- 1 user user 5579574562 Jan 29 2022 tmp.archive.part2.zip
-rw-r--r-- 1 user user 5097536636 Jan 29 ...
0
votes
1
answer
200
views
.DAT files are same as compressed files in Unix?
please confirm if .DAT extension files are same as compressed format files (.zip ) in Unix. As I try to use gzip filename.DAT then file size 2 GB is same after compression?
Is there any alternative to ...
1
vote
0
answers
113
views
unzip a windows archive - some subdirectories are "permission denied"
I have a zip-file created on Windows, so - no specific permissions flags were assigned to the files inside it.
When I unzip the archive:
unzip filename.zip -d ~/path/to/destination
Some (only some, ...
0
votes
0
answers
246
views
Difference in zip functionality between linux and Mac
I just found this odd issue when building and testing a deployment pipeline on my Mac, and then running it in Linux. Assuming, I have this folder structure that I zip up before deploying to a target ...
1
vote
2
answers
451
views
How to fix "unzip: Unrecognized archive format" in FreeBSD? [closed]
I try to unzip a folder that I copied to FreeBSD from another machine through SSH/SCP.
However, I keep getting the error unzip: Unrecognized archive format which to me does not make sense in this case....
1
vote
1
answer
2k
views
How to extract the tar.gz file but without overwriting existing files?
With the unzip -n /path/to/filename/filename.zip command the compressed file is uncompressed but does not overwrite existing files. This approach is useful when the same compressed file was ...
0
votes
1
answer
618
views
Convert octet-stream to zip file
I tried to zip a backup folder that contains 50 GB of data. The result is a octet-stream (full 50 GB) instead of a zip file.
I have already erased the source data before I realize the issue.
Is there ...
3
votes
2
answers
612
views
gunzip multiple gz files with same compressed file name in multiple folders
I have a directory where there are multiple folders, each folder contains multiple .gz files with the same zipped file name "spark.log". How can I unzip all of them at once and rename them ...
0
votes
0
answers
62
views
Zip folder content via CLI inside actual folder
I'm currently trying to create a ZIP file during a GitLab CI job including all data of the CI job (ZIP runs directly inside the folder):
zip -r helper.zip ./ -x .\* helper-hooks.json __MACOSX
The ZIP ...
0
votes
1
answer
248
views
how to skip "is this a single-disk" archive message
after running this code terminal asks me "is this a single-disk archive : y/n". where I need to type y and press enter but I want to do this from the code I am running. In other words I don'...
1
vote
0
answers
100
views
Compress Zip to 7zip
I would like a shell (or other terminal based) script to convert zip files to 7z format.
Some zip files contain folders with more zip files in them. This needs to work recursively since there are zip ...
0
votes
2
answers
494
views
Zip files that match certain data pattern within the file
I have a directory full of files *.CLM_01. I want to create 1 zip file with all files which have the value "005010X222" inside the file. Basically, there are a few files that have "...
0
votes
0
answers
158
views
unzip: can't set permissions of directory 'folder' : Invalid argument
I have the below script to unzip a .zip file and print out a .txt file of the files in the .zip but when I run the script, I get this output:
"unzip: can't set permissions of directory 'folder' : ...
10
votes
6
answers
5k
views
Fastest way to merge millions of small files together
I regularly need to transfer millions of small files (small images, txt, json) with average of 5-50k per file between servers or to aws s3.
Is there a faster to merge them into a single file to ...
0
votes
1
answer
662
views
What is the kind of encryption used in Zip 3.0?
I am using zip on Arch and the version is given as "Zip 3.0 (July 5th 2008) by Info-Zip. Compiled with gcc 11.2.0 on Mar 22 2022. The encryption compilation information reads "[encryption, ...
0
votes
1
answer
848
views
How to unzip folder and change directory to extracted folder
I'm trying to make a script where I can unzip a file and then cd into that unzipped file (ie. unzip test.zip and then cd into the test folder). The problem is that the name of the zip file varies and ...
0
votes
1
answer
236
views
How to find a property file matching a pattern in a group of JAR files?
I'm using bash shell. I have a group of JAR files in directories at different levels
> find . -name "*.jar"
/tmp/jars/META-INF/lib/jackson-datatype-jdk8.jar
/tmp/jars/lib/my-custom.jar
.....
0
votes
1
answer
63
views
Zip all folders in current directory
Im new to shell scripting and I was wondering if there was a way to zip all subdirectories individually in the current directory doing something that seemed familiar to high level programers.
ie:
for ...
0
votes
3
answers
1k
views
Sending Zip files through mailx command
I have a zip file named : zip_final.zip
I have to attach this file as a attachment and send the mail.
Also, I have to display all the file_names present inside the zip file in the mail body.
I have ...
0
votes
1
answer
635
views
Trying to unzip the file but it's giving invalid zip file which overlapped components (possible zip bomp)
Same zip file can be unzipped with the same command on jump node but not on data nodes and the version is same in all the nodes
0
votes
1
answer
833
views
Unzip files with the same name from multiple directories
I have the file archive.zip located in multiple directories, i.e.:
dir/001/archive.zip
dir/002/archive.zip
dir/003/archive.zip
...
Is there a way in which I can recursively unzip all the archive.zip ...
1
vote
1
answer
654
views
Unzip a zip file whose content's name is too long in Ubuntu terminal
I have a zip file, sample.zip, which contains a PDF whose name is too long. I tried to unzip it in Ubuntu terminal through
unzip sample.zip
however, it shows an error that "File name too long&...
-1
votes
1
answer
178
views
unzipping piping error on linux system
I am trying to extract windows 10 and install it on linodes platform and my command is as follows:
wget -O- --no-check-certificate https://www.dropbox.com/s/e9vh4ahwcogi4xo/Win10_21H2_English_x64.zip?...
1
vote
1
answer
29
views
How to compress files include subfolder based on a file modification date
I like to make a script file to backup a upload folder (that have big size), problem is script will backup every midnight so it's quite big zip file.
1st March
Upload
├── sub01/
│ ├── file-01.jpg (1 ...
1
vote
1
answer
114
views
Zipping a folder that contains a zip file (not visible on MacOS unless unzipping via CLI)
I am attempting to create a ZIP archive that contains 5 PDFs and one additional ZIP file (which resides in the folder above the current working folder). This seems to work, but only to a certain ...
0
votes
2
answers
4k
views
How to zip specific individual files in a directory
for example, this folder ~/folder1/folder2 contains a lot of files like:
abc_0101.txt abc_0102.txt ...
abc_0201.txt abc_0202.txt ...
abc_0301.txt abc_0302.txt ...
abc_0401.txt abc_0402.txt ...
how to ...
0
votes
0
answers
528
views
BASH: How to check if a file with a specific content is inside a png image
I have recently found a way to put files inside a PNG image without destroying the image using cat example.png example.7z > example-combined.png, which also works with standard ZIP archives. This ...
0
votes
0
answers
196
views
Zip files according to quarterly year
I have folders sorted according to the date from the past 5 years. I'm looking for ideas on a script or a way to zip all the files according to the quarter year to save my disk space.
For example, I ...