Zip program recommendation


Eisner

Still Fresh
Joined
Oct 3, 2008
Messages
79
Hello,


I have several rom files within one folder that I would like each, compressed. Either .zip or .7z.


In order to make more space on my SD card and given that more emulators are supporting compressed rom files... I thought that this was the best way to go.


Problem is that I have not found a program, with the exception of using scripts, to have each file compressed within a folder. It seems that they either zip one file or a group of files at a time.


I would rather not have to spend a long time compressing each rom files individually if there was a better way to go.


Any suggestions ?
 
Last edited by a moderator:
You wont get around the script part here... just write 2 or 3 lines of bash script and you are done.
 
Something like this should do:



Code:
find . -type f -iname '*.rom' -exec 7z a -mx=9 \{}.7z \{} \;


(Disclamer: I have not tested this and I don't have a Pandora)
 
Sorry, I am a PC guy... ( no comment )


Do I do this on the Pandora, on a PC with Linux ( I just installed Ubuntu on my PC so I do have it now but still need to get acquainted with it).


If run the script on my Ubuntu OS, do I need to have a specific program installed ?


Can I run this script on my PC using a compression program like 7zip ?


Thank you
 
Sorry, I am a PC guy... ( no comment )


Do I do this on the Pandora, on a PC with Linux ( I just installed Ubuntu on my PC so I do have it now but still need to get acquainted with it).


If run the script on my Ubuntu OS, do I need to have a specific program installed ?


Can I run this script on my PC using a compression program like 7zip ?


Thank you
It's a bash script, so it won't work on Windows (unless you use something like Cygwin). It should work on anything with bash (which means most modern Unixes, provided 7z is installed).
 
Ok then, I guess I should break it down then, since it probably looks like some sort of monstrosity to someone unfamiliar :p



Code:
find . -type f -iname '*.rom' -exec 7z a -mx=9 \{}.7z \{} \;

-1-- 2 ---3--- -------4------ --5-- ----------6---------- -7-


1. Find is the command that finds files.


2. The dot means in "current directory". Find also searches in all directories inside it too.


3. "-type f" means to match only files (not directories, links, etc.)


4. "-iname '*.rom'" tells it to find only files ending with .rom (the 'i' stands for case-insensitive, so it will also match .ROM or .RoM)


5. For each file it finds, find will execute a command. Any subsequent \{}'s will be replaced with the file name it found ("mario.rom", for instance)


6. The command is 7z, the command line version of 7-zip. It's told to create an archive ('a') with highest compression ('-mx=9') called "mario.rom.7z", and put "mario.rom" into it. (So the full command is "7z a -mx=9 mario.rom.7z mario.rom")


7. The "\;" tells find that that's all there is for 7z to do.


For more information, you can look up Linux's excellent documentation by running "man find" and "man 7z" (which is actually what you should do before running some weird command someone on the internet gives you ;) )
 
Thank you.. I will give this a try Ubuntu once I install 7zip.


Appreciate the breakdown...
 
Worked like a charm.. Thank you !


One side note.. Damn.. Ubuntu sure does boot fast.. Being use to Windows for all my life, I never could have thought that an OS could be so small in size and load so fast...


Only think that really has stopped me from using Linux before was that I am very much dependent on software made for a PC.


Adobe Illustrator, Photoshop, various 3D software, Word, not to mention the games...


I know there are alternatives to most software but what is the best way to make the transition ?


Do most people use Linux and Windows both ? or just get use to software with in Linux that are alternatives ?


How good are programs like Wine ?


Cheers,


David...
 
I use Linux exclusively, myself (well, I have a second machine for some commercial software I need, which is a MacBook, but it's not my main box).


As Tom notes, WINE is good, and incredibly useful, but do be mindful that it's not something to be totally dependent on - sometimes you'll find that native alternatives work better. (Indeed, I barely use WINE, except for the rare occasions when I need to run an obscure PSX music utility that I sometimes use.)


I have no need to use VirtualBox for running Microsoft Windows, so I can't comment on its usefulness there. I do use it to run a copy of Xubuntu in on my MacBook, though, and it's very easy to use and set up for that.


You might find the Linux App Finder site to be useful for getting pointers to alternatives that might work for you, which you can then install from your Linux distribution's package-manager with a couple of clicks or by typing one line of text and hitting enter.
 
Back
Top