Questions tagged [zip]

For questions about ZIP files and associated tools. ZIP is a file format used for data compression and archiving.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Terminal - Zip files with special characters in password

So I had this question earlier and it got answered "Terminal - Zip multiple directories into separate zip files with password" however I couldn't find out how I can use a password with special ...
0
votes
1answer
429 views

Terminal - Zip multiple directories into separate zip files with password

So I followed the solution here: command to zip multiple directories into individual zip files and I added -er to the command however as I expected, I need to enter the password for every loop ...
1
vote
0answers
17 views

How do I choose the name of the root subdirectory when zipping?

I want to zip up a directory named "foo" recursively. But when I expand the zip, I want everything to be expanded into a "bar" directory. My research shows this can be done if I rename "foo" to "bar"...
1
vote
1answer
798 views

How to unrar multiple split files across different sub-folders

I have a directory that is like this : /x/xxx/rar.00 I'm going manually inside each folder and then merging the files to a single file and then unzip it. How can I automatically merge and then ...
1
vote
1answer
2k views

Crack zip file with parts of passwords known

I have a zip file that I can't open since I forgot the password. I'm pretty sure of some parts of this password but I can't remember the variations I added to it. I tried fcrackzip but I can't see how ...
4
votes
2answers
1k views

How can I repack zip to 7zip?

How can I safely and quickly repack a zip archive to a 7zip archive? I checked options of 7zip program but I don't see any option to repack. I know I can extract to directory and then pack this ...
0
votes
2answers
614 views

Placement of --include list in zip

When I execute the command zip -r --include '*.rb' '*.sh' '*.zsh' '*irb*' tmp/small_v.zip bin I get the error message zip error: Invalid command arguments (nothing to select from) If I write the ...
8
votes
2answers
2k views

Encoding of cyrillic filenames in zip files

There are a few questions here about non-ASCII letters in the names of files stored as streams inside zip files (Hebrew, Chinese, Japanese or Korean). However none of the solutions provided helped me ...
1
vote
1answer
209 views

How can I zip by specifying directory?

I want to zip a directory not everything in the path. I know the command zip -r squash.zip dir1 From the post: How do I zip/unzip on the unix command line? But when I run the command using the ...
1
vote
2answers
1k views

Is it possible to create a zip file without using the zip binary?

Basically I am working on a shell script in Cygwin which requires me to zip a couple of files (it must be a zip can't be gzip). The server I'm working on does not have the zip binary installed and I ...
1
vote
1answer
2k views

How to replace a file in a zip

I'm working with *.jar files, as far as I understand it's an archive format I can manipulate with standard tools like zip or unzip commands. I often need to replace a file already compressed. So far ...
4
votes
1answer
3k views

How to compress files based on a file date

I have a min 30 files in a directory which contains older dates I.e for past 7 days . Now I need to compress them based on its file creation/modified date. For example, 10 files with April 7 -- ...
0
votes
1answer
471 views

Can I view file names from zipped tar file without unzip and extracting it?

Can I view file names from zipped tar file without unzip and extracting it? The command tar -tvf will show the file contents with out extracting it. Is it possible with zipped tar file?
1
vote
1answer
1k views

Validate password for a large set of zip files

I am working on an ETL process for a customer. Another vendor has provided the raw data as a set of approximately 100 password protected ZIP files. I want to validate that the password given is ...
0
votes
1answer
5k views

Create zip file without folder path [duplicate]

I wrote a compressing command in Ubuntu. However,the zip file produced also contain path folder leading to the target file in form of folder. I only need the target file alone in the zip file. This is ...
0
votes
1answer
2k views

How to add a file to a zip with another filename?

Given a file wrong_name.txt, how can I add it to a zip archives archive.zip with an other name right_name.txt without modifying the file itself.
0
votes
1answer
559 views

How to add a text file to a zip in one single command? [duplicate]

I want a put a text file in a encrypted zip archive. I would currently use: echo "<my text>" > file.txt zip --encrypt myarchive.zip file.txt Is there a way to do the same thing in one ...
1
vote
0answers
708 views

How to grep a bz2 file that is further under a zip folder

How to grep a bz2 file that is further under a zip folder - Ex: I have a work.zip folder inside which i got a couple of XXX.bz2 files which have a pattern i am searching for. I want to avoid unzipping ...
0
votes
1answer
75 views

Can list of directories be parsed into a find command?

Suppose I want to unzip files recursively that have the pattern ${file}*.zip in some directory /home/A/XML using find command find /home/A/XML -type f -name "${file}*.zip" -exec unzip '{}' -d /target/...
2
votes
1answer
618 views

unzip nested .zip files by name shell script

I am downloading a zip file which has a very deep nested structure from which I just need to pick a few files. The file structure looks like this: myfile.zip/ C*_01.zip, ....., C*_xx.zip/ In each C*...
0
votes
1answer
194 views

How to unzip a few directories with zip files which also contain sub-directories with zip files?

I've 4 folder & inside each of them, there're a folder XML that contain zip files & some folders with zip files All of the zip files contains files in XML format /A/XML/: BDL_DCR_20170216....
0
votes
1answer
507 views

Find all zip files created today in a directory and its sub directories based on a pattern

I have multiple zip files in a directory and its sub directories with the pattern ACCT_DOC. example T.6593.ACCT_DOC.1054.1_0.20170220.111425.zip T.12561.ACCT_DOC.1003.1_0.20160121.221947.zip I ...
1
vote
1answer
125 views

pkgsrc's unzip is broken?

I'm trying to use pkgsrc on ubuntu 16.04 LTS. Installation was vary easy. $ cvs -q -z3 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc $ ./bootstrap --unprivileged Then I installed unzip ...
0
votes
1answer
466 views

Extract some files from a huge zip file listed in a text file in Linux

I need to extract only specific files listed in a .txt file from a huge .zip file. I tried: cat /HGC/list.txt | while read file ; do gunzip all_human_gene-specific_connectomes_122015.zip find . -...
21
votes
4answers
14k views

Unix system(“unzip archive.zip”) Extracting Zip Files Silently

How do I silently extract files, without displaying status?
1
vote
1answer
586 views

How to wait before mv command completes in unix?

I need to zip some files, move zipped files to some other directory using mv command and then remove all files from original location. But in my case rm command is executing before mv command and ...
0
votes
1answer
269 views

When unzipping files destination directory created with ^M

I am trying to unzip folder using shell script file(.sh). it is extracting files in the zip folder, but my destination directory created ends with ^M, I am using this command in .sh file unzip /tmp/...
0
votes
1answer
934 views

Remote Unzip via SSH not working [duplicate]

Trying to make a script that will copy some files between machines, and unzip them. (Running CentOS 6.7) Everything seems to work except the unzip part, This is the command giving me some issues, ...
8
votes
4answers
3k views

How to add a huge file to an archive and delete it in parallel

Say I have a file of 80GB /root/bigfile on a 100GB system and want to put this file in a archive /root/bigarchive.tar I obviously need to delete this file at the same time that it is added in the ...
1
vote
1answer
256 views

Zip file has different size after copied to flash drive

I created a zip archive named tmp.zip. It has a size $ du -h tmp.zip 1.7G tmp.zip I copied it to flash drive $ du -h /media/tb/tmp.zip 1.5G /media/tb/tmp.zip What's wrong here? How can I ...
2
votes
1answer
916 views

Parallel read the contents of a zipped file without extraction

I have the following zip archive structure: $ unzip -l Undetermined_S0_L004_R1_001_fastqc.zip Archive: Undetermined_S0_L004_R1_001_fastqc.zip Length Date Time Name -------- ---- ---...
0
votes
1answer
439 views

Help creating for loop to zip files with particular suffix and extension

I'm trying to write a script to zip particular files with specific suffixes and different file types in a directory. I see posts about zipping all files of particular extensions, but am hung up about ...
2
votes
3answers
12k views

file-roller: An error occurred while loading the archive (Zip/7z)

As I don't use GUI for archive extraction much, I don't know since when this error I am getting: An error occurred while loading the archive. This error I get while trying to open an ordinary Zip ...
0
votes
2answers
620 views

File zipped using 7za cannot be unzipped using zip utility

I have created this file using 7za command called test.war # file test.war test.war: 7-zip archive data, version 0.4 I am trying to extract this file in another RHEL machine using command : # unzip ...
0
votes
1answer
2k views

Unzip all files into directories with the same name

Ubuntu 16.04 I have a directory with zip files like this: directory | |---zip1.zip |---zip2.zip | ... |---zip_very_large_number.zip Now, I have another directory /home/usrname/anotherdir. Is there ...
0
votes
1answer
147 views

what are -h or -hh, when using the unzip utility?

Did a quick Google search and didn't find a concrete explanation on neither -h or -hh arguments for the unzip utility. Did man unzip and didn't find one as well. I feel sad that there isn't an ...
1
vote
1answer
506 views

How to exclude file when fixing a zip archive

I would like to exclude some files when fixing my zip archive. But following doesn't seem to work: zip -FF old.zip --out new.zip -x \*.JPG How can I accomplish this?
1
vote
2answers
3k views

Zip the entire server from command line

I'm using a Ubuntu 14.04.4 LTS on my server. Is there a way to zip everything on the server in a single archive, preferably with a single command? I've tried using zip -r backup.zip but that doesn'...
4
votes
1answer
1k views

Any way to override path traversal protection in unzip?

When you try to unzip a file with relative paths above the working directory (e.g. ../../foo), you get this message: warning: skipped "../" path component(s) in ../../foo inflating: foo The issue ...
1
vote
1answer
2k views

Compress old log files and move to new directory

I have a folder /home/usr/logs/ which contain log files which are older than 1 day. I wish to compress all the log files older than one day to separate compressed archives (e.g. zip or tar.gz) and ...
0
votes
2answers
180 views

Zipping folder of gz / tar type

I am using tar ssh tectia client. I have to zip a folder with .zip extension in this. In putty i used zip -r Worker_image.zip BlobFiles Worker.dat but this zip command is not identified in ssh ...
0
votes
1answer
35 views

how to unzip to a differently-named file

I need to unzip to a file.txt (not a folder or anything else) something like that: unzip test.zip -d >> file.txt test.zip contain a single file called "x.txt". I do not want to uncompress as ...
5
votes
4answers
1k views

How can I tell if “unzip” will create a single folder ahead of time?

A common scenario is having a zip file in a directory with other work: me@work ~/my_working_folder $ ls downloaded.zip workfile1 workfile2 workfile3 I want to unzip downloaded.zip, but I don't ...
-1
votes
2answers
582 views

Password protected zipping command is not working

I have a assignment to create a password protected zip file from script and sent it over email. I am using below command over sparc-sun-solaris2.10 environment to create a password protected zip ...
2
votes
2answers
124 views

tar's equivalent of zip -o (--latest-time)?

Zip utility allows us to Set the "last modified" time of the zip archive to the latest (oldest) "last modified" time found among the entries in the zip archive with zip -o [...] or zip --...
11
votes
3answers
21k views

Preserving permissions while zipping

How can I preserve permissions while compressing a folder using zip? I know how to preserve symlinks using --symlinks is there a similar option for permissions?
1
vote
2answers
777 views

unable to extract file which is uploaded to FTP server

Source System: CentOS 7 bash shell zip Destination System: FTP server CentOS 6.4 bash shell unzip I wrote a script to archive file and send it to FTP server using shell script #!/bin/bash # ...
2
votes
1answer
80 views

How to zip many n-th level subdirectories, without their top (parent) dir?

in such a filesystem structure: root/ | container1/ | | | subdir2/ | | | subdir3/ | | | ...
7
votes
1answer
2k views

Why does `zip` in a for loop work when the file exists, but not when it doesn't?

I have a directory that contains several sub-directories. There is a question about zipping the files that contains an answer that I ever-so-slightly modified for my needs. for i in */; do zip "zips/...
0
votes
1answer
39 views

Prevent zip from adding subdirectory 'names'

When I run the command zip arch.zip *, intending to add only the files in the pwd and none of its subdirectories, I instead get an archive containing all the files and all the subdirectories of the ...

1 2 3 4 5 9