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
2answers
60 views

Using a regular expression with zip command for directory exclusions

I am trying to zip up my application and would like to exclude all of my image directories apart from one. Consider the following folder structure: /images │ └───/foo // exclude │ └───/bar // ...
0
votes
1answer
104 views

How may I emulate the -R feature of “zip”, but in gzip and xz?

The program "zip" has a -R feature which allows one to zip all files with a certain name in a directory tree: zip -r v/s zip -R For example: zip -R bigfile "bigfile" Will zip all of the following: ...
1
vote
0answers
46 views

zip warning: name not matched compressing folders

I'm trying to backup the whole volume of a drive. I want to have it password-protected This is what I did zip -er archive.zip /Volumes/Storage/ But I'm getting zip warning: name not matched ...
0
votes
1answer
33 views

Extract only sun tar.gz/zip

I have a zip/tar.gz that contain zip files that contains another zip file. For example: 1.zip contains 2.tar.gz and 3.zip. 3.zip contains 4.zip. I want to extract only 4.zip from 1.zip, I don't ...
12
votes
2answers
2k views

How can I create a zip archive without a file extension using the “zip” command?

Normally, to zip a directory, I can do something like this: zip -r archive.zip directory/ However, if I try to remove the extension from archive.zip like this: zip -r archive directory/ It ...
2
votes
1answer
31 views

zip - ignore a large list of specific files without overrunning the command line

I am trying to zip a directory, but I have a list of specific files that I need to ignore. This list is generated with a script and is quite long so when I pass them to the zip command I get an error ...
2
votes
3answers
90 views

Zip -r and wants to exclude/ignore files with no read permission

I have a folder with write-only files, and would like to exclude them while zipping. I don't want to see any warnings or errors related to those write-only files. Please let me know the best way to ...
0
votes
2answers
62 views

Compress many directories with up to 1000 files in archive

Trying all morning, but can't figure it out. Maybe you know. I'd like to compress many directories into zip files, so that each directory is its own zip file. And if there are more than 1000 files in ...
0
votes
1answer
41 views

Script with zip command doesn't work with wildcards

I created a bash shell script to zip all files that match a pattern as follows: #!/bin/bash zip $1 $2 When I run the above script using ./myScript.sh myzip test*, only one file that starts with the ...
1
vote
0answers
35 views

Unknown character encoding for zip file in archive manager

Forenote: I am quite new to Linux, and am really just a beginner. I have downloaded a zip file from a respectable-looking site with firefox; it should contain stuff to install an application. The zip ...
0
votes
1answer
30 views

zip problem in shell script . Why it is wrong?

Write a shell script file_locker.sh to zip a file and protect such with a hashed password of a random generated PIN of specified length, while storing the PIN to a specified file. #!/bin/bash ...
1
vote
1answer
44 views

I want to use output of find command to unzip cmd

I need to use output of find / -type f -printf '%T@ %p\n' | sort -k1,1nr | head -1 command to a unzip command in shell script. Please help
1
vote
2answers
65 views

how to unzip a zipped file which include various zip level files in unix/linux? [duplicate]

For example my folder name is Test.zip Test.zip includes various zip folders like te1.zip, te2.zip , te3.zip even te1.zip include various zip folders. So i need to unzip in linux at once. Could ...
0
votes
1answer
117 views

Bash script to unzip a file — get error: Cannot Find or Open

Here is my script: Z=/var/pixel/sftp/gisftp/pixel_images/pixel_images_archive.zip if [ $Z ]; then echo "$Z exists" unzip $Z -d test else echo "$Z doesn't exist!" fi I get back this when ...
1
vote
1answer
38 views

zip into a particular directory?

Is it possible, from within a bash script, to add a file to a zip file, specifying the destination directory? That is to say, if the zip structure contains directories, can I choose which directory my ...
0
votes
1answer
23 views

If zip runs out of space, will it save a partial zip?

I have been running this command to zip each subdirectory into a zip file: nohup sh -c 'for i in */; do zip -r "${i%/}.zip" "$i"; done' & With that said, I ran out of space, and I am trying to ...
0
votes
2answers
42 views

How to compress multiple folders in the background, each into its own zip archive?

I found that a great way to zip folders into their own zip files is through this loop: for i in */; do zip -r "${i%/}.zip" "$i"; done But I wanted to do this all in the background (e.g., nohup &)...
0
votes
0answers
31 views

unzip command doesn't work with Hyper Terminal

In Terminal we can unzip an archive. I tried the same command in Hyper Terminal and nothing works. Shouldn't all the same commands work? If not, how do I make sure they do? No error message. It ...
0
votes
1answer
53 views

Understanding the command “apt install curl nano unzip -y”

I am trying to understand this command: #apt install curl nano unzip -y I think it to means install curl, unzip the archive and all questions answer yes. Have I understood it correctly?
1
vote
1answer
84 views

Shell script to Unzip files to folders in destination with same name minus the .zip, also move every none zip to same location

I definitely need to practice my scripting... So far I have the script below which works when one .zip and one flat file are put into the source location. If multiple files are put in it does not ...
1
vote
1answer
139 views

Unable to Untar or Unzip from SFTP connection

I am able to zip and transfer files using SFTP with the below commands from my script: zipfilename="Order_$(date +"%Y%m%d%H%M%S").zip" echo "Start Execution" $(date +"%Y%m%d%H%M%S") >> "$...
0
votes
1answer
30 views

Zip a folder while copying it

Is it possible to zip a folder while copying it? I want to copy a folder and then zip it, but this implies that I need for a while twice the space in my /mnt path, right? /bin/cp -r /mnt/myfolder /...
0
votes
2answers
259 views

Is there a way to unzip archive without crushing owner?

I'm actually working on a Windows OS for development purposes. I have some config files which i want to deploy on a linux based system. The structure of the zip generated on Windows is the same as ...
0
votes
2answers
52 views

Unzipping Multiple Files Whithout Overwriting on Identially-Named Files

At an early stage of my script, it needs to unzip "x" amount of files provided by the user. Across the zipped file set, there are name-duplicates (but their contents differ from each other); i.e. both ...
1
vote
1answer
63 views

Is it possible to edit and save files in a ZIP archive with Xarchiver without extracting them?

I know it's possible with GNOME archive manager (File Roller). When editing a text file inside a ZIP archive, pressing the Save button of the text editor will pop-up a window from the archive manager ...
2
votes
1answer
55 views

Unzip command doesn't work in script when run on boot

I have the following bash script: FILE=/home/pi/kpidry/test.zip if test -f "$FILE"; then echo "$FILE exists" rm -r /home/pi/test/* unzip /home/pi/kpidry/test.zip -d /home/pi/test/ rm ...
2
votes
1answer
433 views

bash zip error: Invalid command arguments (short option '\' not supported)

hi guys i have a problem with this code: for dir in ~/Documents/CMDsh/*/ # list directories in the form "/tmp/dirname/" do countFolder=$((countFolder+1)); #echo $dir; #res: /home/arutosio/...
1
vote
0answers
34 views

Transfer folder from server a to b

I have a local virtual machine with Debian and want to move a folder from there to my external hosted server. The problem is that the folder size is never the same after transfer. I already tried to ...
0
votes
0answers
25 views

Extracting a zipped archive (.gz) doesn't extract all of the files (GalliumOS)

Basically, I am installing PyCharm. And when i extract the tar.gz file, a JSON file and a txt file don't appear in the new extracted location. The files are also missing if I use ls to try to view ...
1
vote
0answers
1k views

UNZIP: Cannot find or open filename.zip Error

I have a zipped file (using Winrar) and the size of it is more than 4GB from Windows 10. I've already dumped the file in Unix Server and I want to unzip the file but the error always shows: Code: ...
1
vote
1answer
31 views

Find and zip the individual files and remove the original

Let have a directory with lots of individual .txt files. My purpose is to find the individual files in the directory, zip them with the same name (excluding .txt) individually and remove the original ...
0
votes
0answers
41 views

Tar files in groups by total size

I need to tar (and gzip) a long list of files but I need to do that in groups based on each group size. For example assume I have a list of 100 files, 1Mb each and I want to create archives that are ...
1
vote
0answers
32 views

Bash shell script error after rsync to server [duplicate]

I get this after rsync the .sh file to the server: sudo: unable to execute ./run_vps_post_config.sh: No such file or directory To fix, I open the file with winscp and save it. Then it runs again. (...
0
votes
2answers
82 views

How to know the real file type of files inside a zip or tar.gz file?

I have multiple .tar.gz and .zip files and I wanted to know the file types of files inside these files without extracting them. How can I achieve this. I can list the files of .tar.gz using the ...
1
vote
0answers
145 views

How to enable ZipArchive PHP class

Recently I have installed a PHP on Amazon Linux to run Chevereto. It's an image hosting service. When I wanted to install it on my EC2 instance, I got the following error: Aw, Snap! Your web ...
0
votes
1answer
89 views

Unzipping the parent directory contents ignoring sub-directory and their contents

I am unzipping the .zip file. I'm able to do so but my requirement to extract only the parent folder data ignoring any sub directory and their contents. Below is the name format of zip file. ...
0
votes
0answers
87 views

How can I show a progress bar using Yad or Zenity when unzipping files?

I would like to display a nice GUI progress bar using either Yad or Zenity (doesn't matter to me) when I am running unzip on my files. I am running Linux Mint 19.1. Thank you, -Marcus
10
votes
1answer
887 views

“File type Zip archive (application/zip) is not supported” when opening a .pdf file

I received a .pdf file from someone on a non-linux machine and when i try to open it it says "Unable to open document. File type Zip archive (application/zip) is not supported". So, I rename it "file....
0
votes
1answer
39 views

Zip With Partial J Flag [duplicate]

I'm running: zip -r /var/www/html/example.com/temp/test.zip /var/www/html/example.com/files_to_zip/ which works but gives me the full directory structure of /var. I saw the -j flag which removes ...
0
votes
1answer
310 views

Shell - unzip file and set permission for all files

I have zip file created on windows and I want to extract it on Linux. For extracted files, I want to have permissions 644. However, extracting files end with 770. I have tried umask 644 unzip update....
1
vote
0answers
71 views

native unzipping under wine

Is there a way to extract ZIP-files under wine without resorting to "3rd party applications"? When running windows natively, ZIP-files can be extracted directly in the explorer. However, the explorer ...
0
votes
1answer
1k views

Download ZIP file of private GitHub repository using `wget` like `curl`

There are already some questions with answers how to download the ZIP file of GitHub repositories, but they don't work if the repository is private. I know it should work with wget somehow since it ...
1
vote
1answer
27 views

zip excludes certain js files for no apparent reason

Trying to build a zip package for AWS Lambda that runs a node app. I'm using OSX zip to package the lambda bundle like this: zip -dg -q -FS -R function.zip index.js "*.json" node_modules However, ...
1
vote
1answer
49 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
33 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
60 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
22 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 ...
0
votes
1answer
115 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
299 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
383 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 ...