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.

0
votes
3answers
24 views

Linux determine ZIP size after 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 ...
0
votes
0answers
18 views

Duplicate folder names with .zip or .tar.gz extensions

I am trying to zip or tar the backup folders individually inside parent directory, but what I observed is zip or tar command is creating duplicate folder with .zip or .tar.gz of the original ...
1
vote
1answer
37 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
36 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
21 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
34 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
26 views

How does “unzip -u” work with deleted files? [closed]

I am running zip using the -FS option. This option is taking care of the deleted files. Is there any option for when unzipping that will take care of the deleted files?
0
votes
1answer
26 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
29 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
45 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
635 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
41 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
27 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
267 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 ...
3
votes
1answer
378 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
47 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
70 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
93 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
150 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
48 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
48 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
49 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
123 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
121 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
170 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
54 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
114 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
45 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
744 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
316 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
91 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
310 views

Cannot unzip zip file with password created by winrar in Ubuntu

My problem is pretty much encapsulated in the above title- 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 ...
0
votes
1answer
35 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
460 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
514 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?
0
votes
1answer
72 views

Unexpected behavior: zip -r in bash

I have this script: #!/bin/bash date="20180313" source_path="/Users/<user_name>/Source/Git/WSI" installer_path="../FE_Installer/cdk_installer/*" echo "archive=$source_path/wsi_installers_$...
-2
votes
1answer
39 views

Keep the file extension while zipping a file

I want to zip a file called filename.txt This is quite easily done with: zip filename filename.txt This will create a zipped file called filename.zip However I want to keep the file extension in ...
1
vote
1answer
201 views

how to list content of zip file

I created a zip file which was very large in size, I then split the main zip into chunks of 3GB. I used the command zip test.zip --out new_test.zip -s 3300m which resulted into 3 files test.zip ...
0
votes
2answers
511 views

Unzip a file and process its contents using AWK and pipes

I need to unzip a log file, and then display some specific columns of that log file using awk. Can it be done using pipe? unzip log.zip | awk -F "- -" '{pring $1 " " $2} >newfile
2
votes
0answers
30 views

Exclude subdirectory from zip archive — explain syntax please

I want to zip a folder recursively, but exclude certain directories (temp/.hidden in the example below). I want the zip file to have a top level folder which would be temp in the example below, hence ...
0
votes
3answers
3k views

How to zip all files including hidden files to zip file using linux command? [closed]

I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
0
votes
2answers
251 views

Wildcards in archive inclusion files

When creating a backup using rsync --include-from=inclusion-file, the inclusion file supports wildcards, so you can put + .*rc to include all resource files in your home directory, for example. Zip ...
1
vote
1answer
175 views

rsync-like updating of archive file

When updating a backup using rsync --include-from=files --exclude-deleted, you can get feedback something like: Added file: new.file Added file: other.file Deleted file: deleted.file etc. Is it ...
0
votes
3answers
342 views

Reading first N lines from each member of a zip archive

There are 10 files and they are zipped into Ten.zip. How to read first n lines (say 2 lines) from all 10 files in a zipped file? Is there any easy command for this?
0
votes
2answers
521 views

Unzip and rename a particular directory in zip — in one operation

Say I have archive.zip that contains a directory named myDir (it's actually the only directory inside it) and that this directory contains a file named x. unzip archive.zip -d ~/ brings: ~/myDir/x ...
-1
votes
1answer
2k views

How to curl and unzip to a certain directory? [duplicate]

How to curl and unzip to a certain directory? you curl a file to stdout then unzip to some dir.
0
votes
1answer
405 views

zip only the last directory in the path [duplicate]

To backup my document root (/var/www/html/ I can execute): zip -r ~/backups/all_zipped-$(date +\%F-\%T).zip /var/www/html/ The problem is that inside the created zip file, I get 3 base directories ...
-1
votes
1answer
74 views

Unzip indoes only of a particular tier/level of a zip file, with unzip [closed]

I use this command to extract a zip file containing a backup of my document root: unzip /var/www/html/html-2018-01-08-02\:52\:11.zip -d /var/www/html/ This extracts all data inside the document root,...
1
vote
1answer
88 views

Problem Unzipping huge zip file

I have issues unzipping a huge zip files containing around 1M files. The zip file is 15GB and uncompresses to ~60GB. When I run unzip file.zip -d /directory/to/unzip/at it uncompresses halfway and ...
0
votes
1answer
571 views

How to zip files with same name but different extension?

I have a large directory with files like this: file1.txt file1.meta file1.csv file2.txt file2.meta file2.csv file2.abc and I would like to create zip files like: file1.zip file2.zip I have tried ...