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

learn more… | top users | synonyms (1)

4
votes
3answers
49 views

Is it possible to view the list of file names of a zip file which is inside another zip file?

I know I can use unzip -l file.zip to view the file list of a zip file. But a got a zip file inside another zip file. I tried unzip -l file.zip/sub_file.zip, but failed. Is it possible to view the ...
5
votes
1answer
63 views

Is it possible to fake destination directory path with zip?

Given a bunch of files in the current directory, I want to be able to zip them such that, when extracted, they'd be placed in some given directories. For example, say I have these in $PWD: ls fsck xz ...
-5
votes
3answers
72 views

zip -r v/s zip -R

What is the difference between -r and -R in zip command. Obviously, I have googled about it. Also, I have referred this in quest of finding the difference, but didn't got clarification. Can anyone ...
4
votes
0answers
63 views

How come zipping a created disk image, makes smaller files than piping?

Case 1. I use dd to create an image: dd if=/dev/rdiskx of=/path/to/image bs=1m. It's 16 GB in size. I zip it, and it's suddenly around 100 MB. Case 2. I use dd to create an image, piping it ...
1
vote
1answer
12 views

Unzip all non-existing or older files from archive

The behaviour I'd like with unzip is to extract all files, overwriting any that are older than those in the archive, not touching any that are the same age or newer, and to never prompt. The options ...
6
votes
2answers
166 views

Is there a way to convert a zip to a tar without extracting it to the filesystem?

Is there a way to convert a zip archive to a tar archive without extracting to a temporary directory first? (and without writing my own implementation of tar or unzip)
1
vote
4answers
74 views

Why can't tar extract .zip files? [closed]

I tried a majority of the formats (gzip, etc.) to extract a zip file with tar, and when I became frustrated enough to Google for it, I found no way to extract a zip file with tar and only ...
1
vote
1answer
35 views

Does “freshening” a zip file with the -FS option change the modification time of the file?

I have a zip file that I use as a backup for my work. I use the "freshen" option (-FS) whenever I want to update my backup file. However, the file shows the date of last modification as being the ...
0
votes
0answers
48 views

zip command is failing during high memory usage

We have several perl scripts, which generates and emails reports. The script that emails the files expects a .zip extension. The report scripts generates a .txt or .xls file and then runs the ...
0
votes
1answer
40 views

Pass list of folders to zip command

I have a folder which contains lot's of folders in it. I don't need to zip all of them and I have a list of folders that need to be zipped in a separate file The folder list is in the following ...
5
votes
2answers
187 views

How to zip a file and save it in another directory

How can I zip a file and save it in another directory using the command line? I have no space left in directory (100% full).
0
votes
1answer
59 views

Error unzipping file through ksh, unzip works through bash

I have an auto-generated zipfile foo.zip on a Red Hat server that needs to be extracted to a particular location /bar. This is done through an install script using ksh. When the script executes unzip ...
0
votes
1answer
70 views

Error when unzipping a file

I am getting the following error when unzipping a file unzip user_file_batch1.csv.zip Archive: user_file_batch1.csv End-of-central-directory signature not found. Either this file is not a ...
1
vote
1answer
569 views

How can I ignore “zip warning: name not matched” when using zip command with -d option?

I am creating an sh file to run multiple commands in the background. At some line in this file, there is a command to update a zip file like: zip -d archive.zip file.txt This file.txt might not be ...
4
votes
3answers
137 views

Bash: Zipping/grouping files by common substring

I have about 100 files. They are named like this. 3000_ABCD_XXXXXXX.csv 3000_ABCD_YYYYYYY.csv 3000_ABCD_XYXYZYZ.csv 3000_EFGH_XXXXXXX.csv 3000_EFGH_YYYYYYY.csv 3000_EFGH_XYXYZYZ.csv ...
0
votes
1answer
20 views

Working with the option -x in zip

I can't manage to figure out the -x option in the command zip. I want to compress a working folder to save it as a backup, but I have some files and a directory that contains huge files that I don't ...
2
votes
1answer
66 views

Can p7zip create smaller zip files than winzip?

7-Zip for Windows creates smaller zip archives than WinZip, so presumably P7zip can create smaller zip archives than Zip in Linux. So how do I create zip files using P7zip in Linux?
2
votes
1answer
40 views

How to list files in a zip without extra information

en I use unzip -l test.zip I get the output like this: Archive: test.zip Length Date Time Name --------- ---------- ----- ---- 810000 05-07-2014 15:09 file1.txt 810000 ...
-1
votes
2answers
162 views

Sending zip file containing plain txt file via email

How to send a plain txt file in a zip file via email in unix? The contents in the txt file should be word wrap.
2
votes
3answers
56 views

How to know the path to a specific file in a zip archive, without extracting it?

I only know the filename but not its exact location. I would like to extract only that file from the archive. And I need to know its location in the archive.
6
votes
4answers
319 views

How to only zip the files of a specific user?

I like zip, it's simple, but recently I came with the need of only zipping the file owned by one user in a directory. I read the manual and I can't find any option to for example do things like: ...
2
votes
2answers
98 views

Compress zip files with higher compression

I have a large number of zip files that were compressed using the zip command. I would like to recompress them with the -9 flag to improve the compression ratio. Does anyone know if that can be done ...
0
votes
2answers
555 views

Unzipping error

When I enter unzip ../founation-latest.zip, it outputs this: warning [../foundation-latest.zip]: 248 extra bytes at beginning or within zipfile (attempting to process anyway) The file is 138KB. ...
0
votes
1answer
718 views

Depsolving for php-pecl-zip

I'm having trouble getting rid of my depsolving errors, and I've been left to figure this one out on my own. It all started when I wanted to upgrade from PHP 5.2 to PHP 5.3 (heaven forbid), and I was ...
1
vote
2answers
186 views

Text substitution inside compressed files

I have several zip files, each one having several text files inside them. I want to substitute all occurrences of a in these text files with b, and leave them zipped with the same structure. If I ...
2
votes
1answer
218 views

Find & Delete directories in .zip files

Question 1 : In many .zip archive files I would like to delete directories anwsering to a name pattern. In a "normal" directory I used : find . -type d -name "pattern" -mtime +30| xargs rm -r Is ...
0
votes
1answer
79 views

Order a list of files, by date modified, then unzip them in that order

I have a list of zip files, that must be extracted by date modified, they contain updated images and the strange way the local mls provides them means that newer zip files container newer versions of ...
3
votes
4answers
985 views

How to zip recursively all subdirectories that only contain text files

I have a backup from a disk that contains data files and analysis. The dir structure and names are not really consistent. To save space, I would like to zip all the subdirs that only contain data ...
2
votes
1answer
112 views

tar.bz2 7zip selective extract prformance

We use tar.bz2 as our archive of server logs. We also write tools that selectively parse these archived logs. Many times I must regex-search one file’s lines in the archive to determine if other ...
2
votes
2answers
133 views

How to use `expect` with `zipcloak`?

I create a zip file using zip which includes several files and directories, named test.upd. Now I want to use expect to automatically handle the password encryption. Here are two bash scripts, both do ...
2
votes
1answer
374 views

Facility on AIX to ZIP a list of files

I'm working with an external company who is using AIX (version unknown) as their platform. They are required to FTP me a ZIP file containing multiple files. Does the UNIX utility zip exist on a ...
0
votes
3answers
244 views

unzip a directory in unix [closed]

I tried to unzip a folder in Unix: $ unzip sample.zip This is creating the root structure a/b/c/d/e/f/sample. Please advise. I need to unzip a folder in the current directory.
3
votes
2answers
267 views

Create Zip for each subfolder but containing only matched files

I am trying to figure out how to create a zip file for each subfolder containing only files that match my criteria. For instance I have: Folder1 Folder2 Folder3 Each folder contains the same set ...
1
vote
1answer
524 views

extract only a specific folder Contents from a zipped archive to a given directory [duplicate]

This is very close to the SO How to extract only a specific folder from a zipped archive to a given directory? I need something close but I always get the folder with the contents, not it's contents ...
1
vote
2answers
603 views

Having trouble uncompressing a few files [duplicate]

So I have to uncompress 4 different files. When I do file file1 file file2 file file3 file file4 for example, different messages are displayed. For example one starts like "gzip compressed data, ...
2
votes
3answers
178 views

zip a directory that name start with `-` [duplicate]

How can I zip a directory like -foo? $ zip "-foo" "-foo" shows only help page. I think -foo is recognized as a options, but I don't know how to solve it.
8
votes
1answer
296 views

Do any archive utilities exist that can preserve the date created file attribute on NTFS-3G?

I tried the -X switch on zip, but that did not save the date created attribute. I can get it using this method. When a file is added to a zip archive using 7-Zip, it preserves the date created and ...
4
votes
3answers
2k views

speed up gzip compression

Is it possible to speed up the gzip process? I'm using mysqldump "$database_name" | gzip > $BACKUP_DIR/$database_name.sql.gz to backup a database into a directory, $BACKUP_DIR. the manpage ...
0
votes
1answer
208 views

Does zip's -u flag pay attention to deleted files?

This website about Linux's zip utility says this about the -u flag: Replace (update) an existing entry in the zip archive only if it has been modified more recently than the version already in the ...
2
votes
2answers
568 views

Zip folder without including path to folder and require only one argument

I'm trying to make a zip function that'll do all the steps I typically do when zipping a file or folder. Say my current directory is ~, and I want to zip a folder named Folder1, whose file path is ...
2
votes
2answers
251 views

Junk a part of the directory with unzip?

A zipfile f.zip contains a bunch of files all with directories. A/B A/B/C A/B/C/D .. A/B/C/D/and/some/more/dirs A/B2 Now I'm only interested in the tree below C/D. I can do unzip f.zip */D/* ...
0
votes
3answers
413 views

High CPU utilization with zip command

When I am using the zip utility in Linux to compress files, CPU utilization is going to 100%. Can anybody help me why CPU utilization is so high? I'm using the command: zip file_name *.xml
3
votes
4answers
1k views

Change working directory

I'm trying to compress a directory at /home/cyrus/sql And I wanted to change the working directory when zipping the folder: / $ zip -b /home/cyrus sql.zip /home/cyrus/sql But when I check the ...
6
votes
2answers
884 views

Add a file to a different path in a zip file

I have a file that placed in the following directory: folder_A/another_folder_A/file_to_add.xml Now, what I want to do is simply add the file to a folder in an existing zip archive. For example ...
0
votes
3answers
2k views

How to get extract/compress option on right clicking?

I am using Linux Mint 14 Nadia . Earlier whenever I right clicked any folder I got options like Extract it, Compress etc. But now I am not getting them . Probably I changed/deleted some of the ...
2
votes
1answer
2k views

Unzip file contents, but without creating archive folder

I have a file myarchive.zip that contains many directories, files, etc. Let's say this myarchive.zip file lives in a directory called "b". Well, when I use the "unzip myarchive.zip" command, the ...
2
votes
2answers
208 views

What scripting language can I use to automate a concatenation & zipping process?

For a project I'm doing I need to concatenate and compress (with zip) many (midi) files and compare their sizes. I've thought there must be some language that allows me to do something like this: ...
4
votes
4answers
558 views

unzip file, which directory was created?

Objective: After expanding archive a.zip by using command unzip on Ubuntu 12.10, assign the name of the folder a.zip expanded to to bash variable v. a.zip is assumed and guaranteed to expand to a ...
3
votes
1answer
682 views

Encoding of a zip file

When I extract some file (mp3) with japanese or korean characters within its filename on Windows, they appear normally, but when I extract it on Linux (Ubuntu/Mint) they appear as something like this ...
7
votes
1answer
8k views

command to zip multiple directories into individual zip files

I have a single directory that contains dozens of directories inside of it. I'm new to command line and I'm struggling to come up with a command that will zip each sub-directory into a unique ...