0
votes
2answers
72 views

Linux zip and exclude directory in Bash script

I am trying to write a bash/shell script to zip up a specific folder and ignore certain sub-dirs in that folder. This is the folder I am trying to zip "sync_test5": My bash script generates an ...
0
votes
0answers
34 views

How to rewrite bash shell script to nyaos script

I'm using this small shell script named zip0 in linux environment. #!/bin/bash zip -0rq "${1}.zip" "./$1"; I also want to use this function in windows nyaos script. By direct input from shell $ ...
1
vote
1answer
138 views

How do i unzip files from a nested folder?

Say i have the following .zip file: ZipFile.zip /zipfolder/ this.file that.file theother.file When i try: unzip ~/path/to/my/ZipFile.zip -d ~/path/to/my/destination/ ...
-1
votes
2answers
120 views

zip subtitle files recursively on linux

I got 2 main folders Peliculas and Series, as you may guess Peliculas has movies on it (some of them on their own folder, the ones that have more than 1 file) and the folder Series has tv shows. What ...
0
votes
0answers
149 views

OSX : Find all zip and rar in a selected folder then unzip and unrar

I am in the process of cleaning a huge library of mangas (mostly -but not only- image files ). Each manga has a main folder containing the different volumes, sometimes in .zip, sometimes in .rar. ...
2
votes
1answer
266 views

Remove sub directories / sub folder from zip + rar files

I have a bunch of .zip and .rar files. Many of these files contain subfolders in the archive. I want to remove all the folders from the zip files but keep the other content. e.g. original.zip - ...
1
vote
2answers
276 views

Recursively zip files into .cbz-files based on folder in command line

I'm trying to figure out how to write a script to automate creating .cbz files from images in folders on OSX. My directory tree will look like this: /toplevel/ cbz/ comics/ Comic1/ ...
0
votes
0answers
163 views

Edit Zip files recursively using VI editor

I have a use case in which I want to edit a file using vi editor which is bundled inside a war package and the war package is bundled inside an ear package. I am on a linux machine Oracle Enterprise ...
0
votes
3answers
103 views

Listing files, including archive contents

Is there some method to find, from the shell, all files matching a file pattern including those inside archives (specifically: zip archives)? The simulation package "VASP" produces files called ...
1
vote
1answer
250 views

Remove __MACOSX directory in zip files by using shell

I want to remove __MACOSX directory in zip files that are made by Mac. With zip foo.zip -qd "__MACOSX/*" works well. Then I wrote like following. for file in "*.zip"; do zip $file -qd "__MACOSX/*"; ...
2
votes
2answers
426 views

Create zip files that with given size

My question is same as in Create multiple zip files that are not dependent on each other? but my idea is to add files to zip until it is of required size and continue with a new zip file for others ...
0
votes
1answer
140 views

Substitute for zip command or way to zip files

I want to zip files using the zip command, but my terminal says -bash: zip: command not found Is there a way to get the zip command, or maybe use another command instead?
14
votes
1answer
7k views

Remove single file from zip archive on Linux

I have a zip archive (created automatically in a script with -j -r flags) and I would like to remove a single file from it. I tried as documented. zip -d "picture_43_9.jpg" gallery.zip but I get ...
2
votes
2answers
305 views

Exclude files in a for loop

I want to delete the /lib directory inside apk files. I managed to do this with: for DIR in ~/ABC ~/ABD do cd $DIR for APK in * do if test -f "$APK" then zip -d $APK ...
2
votes
3answers
300 views

osx: selectively zip large number of files: -@ option OK?

I need to make a zip file archiving ~100k files from a directory containing ~500k files. I get "argument list too long" errors when I try the obvious commands: zip archive.zip *pattern*.txt ...
1
vote
2answers
74 views

unix command zip everything except file ending with _fpartxx

I was wondering, if I have a folder structure like this: /var/www/testing/file1.iso_fpart0 /var/www/testing/file1.iso_fpart1 /var/www/testing/file1.iso_fpart2 /var/www/testing/file1.iso ...
4
votes
3answers
5k views

shell scripting - How to zip contents inside a folder without the folder itself?

I use this current command that archives the folder "folder-root" and all it's content to a file named "site.zip": zip -r site.zip folder-root/* Problem is - I want to zip the contents of the ...
51
votes
5answers
2k views

How to “unextract” a zip file?

I extracted a zip file into a non-empty folder. The zip file has lots of files and a deep hierarchy, that merged with the existing tree of the target directory. How can I remove the files and ...
1
vote
3answers
74 views

A better way to extract lots of files from zip archive in bash

I have a zip archive with lots of files and a plaintext file with list of files (~10000 items), that I need to extract from that archive using bash. What is the best way to perform that operation? ...
0
votes
1answer
536 views

How to recursively `zip` all files of a certain type in a directory?

I want to use the zip command to create a .ZIP of a folder but only include .txt files. Subdirectory structure should be preserved!
2
votes
1answer
359 views

Zip Multiple Text Files from Multiple Directories into One ZIP File in One Command in Bash

I have an account on AWS and I use S3 for storing data. I have commands that will enable me to zip data files like so: data.zip s3_dir/level-1/level-2/*/*/data.txt But there are, say, 50 or more ...
4
votes
3answers
171 views

Accidental Extract Location - How to Clean Up?

Sometimes I will do a command such as unzip tons_of_files.zip And I will forget to put a -d to point to a subdirectory. This causes the current folder to get filled with tons of files that are ...
2
votes
3answers
548 views

zip being too nice (Mac OS X)

I use zip to do a regular backup of a local directory onto a remote machine. They don't believe in things like rsync here, so it's the best I can do (?). Here's the script I use echo ...
10
votes
2answers
8k views

Avoid unwanted path in Zip file

I'm making a shell script to package some files. I'm zipping a directory like this: zip -r /Users/me/development/something/out.zip /Users/me/development/something/folder/ The problem is that the ...
4
votes
2answers
4k views

Bash command to compress folder(s) with a password

How can I compress two folders into archive file (zip, gzip or something like that) with a password on the files? For example I have folder structure: rootDir dir1 dir2 dir3 dir4 I need bash ...