Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [zip]

Zip is a file format used for data compression and archiving.

1
vote
1answer
34 views

Zipping all sub directories

Trying to zip a backup directories inside a parent directory data/ which looks like this data |- 2019-04-01 |- data.gz |- data2.gz |- 2019-04-09 |- data.gz |- data2.gz I would like ...
0
votes
2answers
30 views

Is it possible to have a zipfile in which only some files where encripted/password protected?

Would like to create a default project structure, but some business areas of the company do not need to have access to some assets (so I wanna block them). Is there any way I could create a zipfile ...
0
votes
1answer
21 views

How can I eliminate an “@eaDir” in Zip CLI?

I've tried many derivations of the following: zip -r test.zip /volume1/docker/test/ -x "*.DS_Store" -x "*.pyc" -x "@eaDir" The DS_Store and pic files are omitted but the directory @/eaDir and all ...
0
votes
0answers
16 views

Rewrite files last modified date

I have a folder of contents which I wish to archive. Each file has a different last modified date. Is there a way to change the last modified date of all the files to a specific one from the past? I ...
1
vote
1answer
35 views

How do I prevent a __MACOSX from being created when I extract an archive that I created on MacOS?

From commentary in "Rewrite last modified date when unzipping archive": I have a ZIP archive that I created on MacOS. Whenever I use bsdtar xmf file.zip or unzip -DD file.zip to extract it a new ...
0
votes
1answer
47 views

Rewrite last modified date when unzipping archive

Is there a way to rewrite the last modified date of all the files inside a .zip file to the date of extraction? Basically, whenever someone unzips the archive, the last modified date of all files is ...
4
votes
1answer
354 views

Zip/Tar file compressed to larger size? [duplicate]

I have 4 files that I want to include them in a .zip file. drwxr-xr-x 7 skemelio themelis 4,0K Οκτ 18 00:21 CSharp drwxr-xr-x 11 skemelio themelis 4,0K Οκτ 18 00:17 gnome-games drwxr-xr-x 8 ...
0
votes
1answer
34 views

Batch 7zip all files separately in a directory (Centos 7.6)

I am trying to 7zip all files inside a directory separately into their own archive (for each file) in Linux Centos 7.6. Been looking around for a while but never found a method.
0
votes
1answer
134 views

zip command show warnings “name not matched” about symlinks, outside of my working directory, pointing to non-existing target

I have some weird warnings when zipping a directory's content. I use a command line I use for a ton of websites backup since years and never had such issue, and I try to figure out why I have the ...
1
vote
1answer
23 views

Using terminal to zip unknown amount of packages with dynamic names

I am trying to figure out a solution for unix based systems (maxOS, Linux) to zip unknown amount of packages, ideally without requiring users to install any additional third party software. I have ...
0
votes
3answers
72 views

Zipping the 10 most recent files

Basically my requirement is to find 10 latest logs and compress it into zip. I have tried command ls -Lt | head -10 | zip log.zip *.log, but output is not matched.
0
votes
1answer
42 views

Adding magic numbers/file header back to a zip

As part of a program I am in, I have been given a zip file that won't open. I have worked out that the file header is missing from the zip, but I am not sure how to put it back. Simply replacing the ...
0
votes
1answer
149 views

“No space left on device” when extracting tar archive

I am trying to unzip a tar file using tar xvzf ZAP_2.7.0_Linux.tar.gz here is the file. What could be the problem? -rw-r--r-- 1 root root 32165888 Mar 6 12:06 ZAP_2.7.0_Linux.tar.gz -rwxrwxrwx 1 ...
1
vote
0answers
25 views

Zip64 Extra Information Field

While trying to analyze zip files, one section Im a little confused by is the Zip64 Extra Information Field. It is expected to be generated when specific fields can't fit in the file header(Central ...
1
vote
1answer
50 views

Terminal command to add a directory to many existing zip files

I am using the below command in Terminal, found here from this answer by @Theophrastus to zip all *.html and *.js files with the same name, while retaining the name of those paired files. How to zip ...
5
votes
2answers
602 views

What method does unzip use to find a single file in an archive?

Let's say I create 100 files with random text data of size 30MB each. Now I create a zip archive with 0 compression i.e. zip dataset.zip -r -0 *.txt. Now I want to extract just one file from this ...
0
votes
1answer
35 views

Script “7 days log tar and then remove the 7 days logs and exclude the tar file after next 7 days”

I am trying to create a script such that it could tar.gz all the previous log of per 7 days log and exclude the tar file in next run. Is the script ok or should I have to make a change find /home/...
0
votes
1answer
79 views

Bash script to move through folders, unzip, and move files up one directory

I have a group of folders that all have zip files in them that may contain 1 or 2 files in them each in a new folder. (see diagram below) I want to point the script at the top level directory and ...
2
votes
1answer
379 views

How to zip directory excluding symbolic links and the files they point to?

I have a directory with files, subdirectories and symlinks How to zip only files and folders from that directory without symlinks or files referred to by the symlink?
0
votes
0answers
45 views

How to archive into multiple zip a directory containing several millions sub directory?

I have large directory that contains several millions+ sub-dir, each sub-dir contain 3 or less image files. What is the most efficient way for me to zip them so I can move it to a new server? The sub-...
13
votes
1answer
3k views

Is this a zip encryption bug?

I have recently discovered an exploit, where I(or assuming anyone) can re-encrypt my encrypted zip file without having to know the password: #zip --encrypt encrypted.zip -r dir1/ The above will ...
3
votes
2answers
784 views

Unzip to a folder with the same name [duplicate]

How to unzip a file (ex: foo.zip) to a folder with the same name (foo/)? Basically, I want to create an alias of unzip that unzips files into a folder with the same name (instead of the current ...
0
votes
2answers
105 views

Why does libarchive's bsdtar's unzip throw away the permission bits when reading a ZIP-archive from stdin, but not directly?

I encountered that the command bsdtar from the package libarchive (under Arch Linux, at least) does throw away executable bits of files in .zip-archives when reading from stdin, but not when directly ...
3
votes
1answer
44 views

Is there a CLI utility to compute the same CRC as used in ZIP files?

# Create random file **$ dd if=/dev/urandom /of=./test.dat bs=1K count=1 # Zip it **$ zip test.zip test.dat # Dump contents for ZIP-computed CRC unzip -v test.zip Archive: test.zip Length ...
2
votes
1answer
112 views

Easy way to change compression level of a zip file [duplicate]

On linux, is there an easy way to recompress a zip file (changing compression-level) with preserving as most meta-data as possible (timestamps etc.)?
0
votes
1answer
49 views

Extract zip bundle into same file

I want to bundle below three files and extract into the same folder. files1.txt files2.txt files3.txt zip -r myfiles.zip files1.txt files2.txt files3.txt Output When extracting the zip: files1....
1
vote
0answers
278 views

libzip Linux cross-compile configuration

I am trying to cross compile libzip-1.5.1 having previously successfully complied zlib-1.2.11 (these are required by libzip and I have installed in a local home path), but I am experiencing problems ...
1
vote
0answers
39 views

A simple utility to backup of both database (MySQL) and document root into one file

In Ubuntu-LAMP with Bash I host a few personal websites. All websites are under document root (/var/www/html). This is how I currently create immediate backups on maximally-self-managed cloud ...
3
votes
1answer
32 views

How to obtain only fully decompressed files in destination folder when decompressing zipped file?

I'm trying to decompress a big zip file containing more that a hundred files, 128 MB each. When the decompression is interrupted, I have to delete the last file that was being decompressed, and ...
1
vote
1answer
237 views

How can I zip all files in a directory without compression and using AES256 from a Debian Terminal?

How can I zip all files in a directory without compression and using AES256 from a Debian Terminal? I have a folder. I want to zip all files in it without compression. Input: File1 File2 File3 ...
0
votes
3answers
319 views

Linux determine ZIP size without compression

I would like to make a ZIP file using zip command. Zip file would contain large number of directories containing large numbers of subdirectories, files etc. Is there any way to calculate final size ...
1
vote
1answer
208 views

KSH shell script zip command not working correctly: eval: zip: cannot execute [Exec format error]

First off, our development environment just got upgraded to RHEL 7.5 (Maipo), we were previously on Oracle Solaris 10. Once we switched from Solaris to Red Hat this problem began. The Korn shell ...
0
votes
3answers
41 views

Grab the oldest 100 files out of thousands and zip them up but also create a listing of those files that I can cat out later

I was wondering if there is a way to grab the oldest 100 files from a directory that has a 1000 or more in it with the same prefix (cdr12345.csz, cdr32342.csv, cdr 98876.csv, etc..) and list the names ...
1
vote
1answer
298 views

Add files to zip archive skipping existing files with zip command

Is it possible to skip existing files when adding files to existing archive with zip command? zip -u adds only changed or new files, but I need to add only new files, skipping 'changed'. ...
0
votes
3answers
197 views

How can I create a v1.0 zip archive?

How can I make a v1.0 zip archive, so that when ran against file returns Zip archive data, at least v1.0 to extract When I create a zip file with the zip command line utility or Xarchiver, file ...
0
votes
1answer
38 views

Anonymise Zip files in a folder recursively

I have multiple zip files in a parent folder as well as subfolders. I would like to replace all those zip files with a dummy zip file. In other words: * the original zip file content being ...
0
votes
1answer
50 views

Combine zipfile: with scp: to open remote zip with vim?

Both vim scp://remotehost///path/to/file.txt and vim zipfile:/path/to/file.zip::path/inside/zip/file.txt work for opening either remote or a file inside zip archives. What if one needs both at ...
2
votes
0answers
274 views

office files are being read as zip archive and vice versa. How can I resolve this?

I am running Manjaro linux KDE and am enjoying. But opening office & zip file is a pita for me. Look the screenshot. My zip file opens by libreoffice (or WPS). And if I correct it in file ...
6
votes
2answers
1k views

Bash loop unzip passworded file script

I'm trying to make a script that will unzip a password protected file, the password being the name of the file that I will get when unzipping Eg. file1.zip contains file2.zip and it's password is ...
0
votes
1answer
46 views

Is it a good habit to rm zip file before packing folders?

I have a folder with some files. I need to backup them daily. I am using Debian and zsh and I use zip for the tool to backup them. I am updating the folder from time to time, adding new files, ...
0
votes
1answer
62 views

Zip command creating a directory while unzipping the file

Am creating a zip file in the script, when I run the script and go to the target folder and unzip the zip file I created in script, it's creating a directory and unzipping the file in that directory. ...
0
votes
2answers
286 views

How to compress a file into zip format without having zip package installed [duplicate]

How to compress a file into zip format without having zip package installed? Pretty much what I need to do. I tried tar -czf loremipsum.zip but the format isn't a correct zip format when I try to ...
4
votes
1answer
704 views

unzip not extracting: caution: not extracting; -d ignored

I have a ZIP archive, foo.zip, with some files not contained within a directory. I want to extract them to the local foo directory. I'm trying to extract them with this command: unzip -v foo.zip -d ....
0
votes
2answers
55 views

zip files within all sub-directories of a given parent directory

Say I have a parent_directory/ with the following sub-directories child1/, child2/ and child3/. How do I script to zip all *.txt files in childx/ into childx.zip I also want this childx.zip to be ...
1
vote
2answers
94 views

find and zip multiple file extensions while keeping the folder structure

Ubuntu 16.04 I would like to backup all .txt, .cfg, and .ini files, while keeping their folder structure to a zip file in the backups folder. I know there is an easier way to do this entire ...
1
vote
2answers
285 views

Zip but do not scan excluded folder

I am making a zip of a directory. I used this command to exclude a certain folder zip -r myzip.zip /home/test -x share/\* When I used this command it still scans through that folder. It has ...
2
votes
1answer
78 views

Finding the Count for a String on Multiple Zipped Files in Multiple Directories (non aggregated)

I'm trying to figure out the number of lines that contain the strings "event" and "type". The files I want to search through are in multiple folders and are zipped. I'm able to get an aggregated count ...
0
votes
0answers
104 views

Cannot zip a mutli-part archive, zip -FF command failing with out of memory error

Command zip -FF xxx.zip --out final_xxx.zip Fails with zip error out of memory or zip error : cannot split, read, write, file is too big.may be result of bad comrpression , try -fz I do not how try ...
0
votes
1answer
58 views

Unzipped/zipped file search

How am I able to search for duplicate files that are zipped and unzipped, with the same name? I understand I can do the initial search with the below however, not sure how to pipe in some duplicate ...
0
votes
2answers
292 views

Is there any way to unzip the file in linux without being through the “unzip” command?

Is there any way to unzip the file in Linux without being through the unzip command? We can not install the software unzip or any decompressor for now and need to unpack some files in a script that ...