Stack Exchange Network

Stack Exchange network consists of 174 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
votes
0answers
33 views

Check if multiple zip files (multi-part) exist in a folder

What is the bash syntax for checking if a folder contains a multi-part zip file? as part of a Batch script. If statement is what I would like but struggling. Test data I am dealing with is roughly ...
-1
votes
1answer
37 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
545 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
26 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
44 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
122 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
42 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 ...
0
votes
2answers
185 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
73 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 ...
2
votes
1answer
31 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
54 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
37 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
138 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
116 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
169 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
124 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
38 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
222 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
117 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
32 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
36 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
191 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
42 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
42 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
280 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
570 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
53 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
81 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
214 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 ...
0
votes
0answers
245 views

Nested Zip files [duplicate]

I have numerous zip archives, each of which contains a number of zip archives. What is the best way to recursively extract all files contained within this zip archive and its child zip archives, that ...
2
votes
1answer
64 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
87 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
55 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
243 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 ...
1
vote
2answers
247 views

Zip all subfolders inside a folder to individual zip file

I have around 200 folders right under a huge folder Parent, say as child1-100 -Parent ----child1/contents ----child2/contents How do I change all the folders named child 1-100 into each zip folder,...
2
votes
3answers
343 views

Unix unzip is failing but Mac Archive Utility works

I have a bunch of files with a .zip extension that I cannot seem to extract on my HPC: $ unzip RowlandMetaG_part1.zip Archive: RowlandMetaG_part1.zip warning [RowlandMetaG_part1.zip]: 13082642473 ...
0
votes
1answer
56 views

How to know where the last file created by my current user is located?

I use Ubuntu 16.04 (xenial) with Bash 4.3.48(1) and zip 3.0. In a file containing a bash script (#!/bin/bash) with many different functions, I also have this function used to create a full database ...
1
vote
1answer
119 views

Hyphen (-) ignored in the end of a piped command nested inside a function?

I use Ubuntu 16.04 (xenial) with Bash 4.3.48(1). Based on the answer of Stephen Kitt in this session, I tried run the following command as part of a function named imb(): mysqldump -u root -p --all-...
4
votes
3answers
48 views

Decompressing archive to a single folder

Maybe this is the pinnacle of first world problems, but after years of angst I just have to air this. Let's say you have downloaded funtool.zip in your ~/Downloads folder. You have two choices, each ...
2
votes
3answers
1k views

Any work-around to pipe zip files? [duplicate]

I use Ubuntu 16.04 with Nginx and Bash. I know that it's not possible to directly pipe data into zip. For example, if you host websites on Apache/Nginx webserver, this command set would fail after ...
1
vote
2answers
976 views

Want to Zip files based on modified date

A file (Paths.dat) which contains multiple Paths where it needs to find files which are 15 days old and zip it in same folder with modified date. Paths.dat :- contains multiple paths in File system ( ...
0
votes
0answers
165 views

How to open a zip bomb in linux [duplicate]

I have the famous zip bomb 42.zip Reference : http://www.unforgettable.dk/42.zip How do I extract it recursively on my Linux machine ?
1
vote
1answer
386 views

Cannot unzip zip file with password created by winrar in Ubuntu

I have a zip file made in Windows 7 with winrar which opens with the password just fine in Windows- but both Ubuntu unzip from GUI and python zipfile utility running in Ubuntu cannot unzip the file ...
0
votes
1answer
43 views

unzip files with yesterday date to 'other' location not working

I can unzip just fine like this find /file/location -mtime -1 -print -exec unzip -o {} \; But I get an error if I try to make it unzip to another location /home/username: find /file/location -...
2
votes
3answers
575 views

How to unzip only certain files that follow a specified pattern?

Using bash. Considering I have a directory D containing the following files: 20170301:00.out.gz 20170301:01.out.gz ... 20170302:01.out.gz 20170302:02.out.gz etc. The files follow the pattern '...
0
votes
0answers
627 views

Is it possible to unzip a password-protected zip file without the password, but an AES key?

I am trying to unzip a file that is password protected, but I have an AES key that could possibly open the file. Can .zip files be decrypted without the password but with a supplied AES key?