Tag Archives: Mac

Batch Zip and Rename – I love the Terminal!

Today I needed to compress numerous (around 25) directories into individual archives (in this case, zip’s) and then rename them with a different extension (in this case ‘cbz’). This would have been extremely painful to do manually… I mean, right click a directory — one at a time — then left click “compress” (or zip, depending on the context menu)… and I’m not even going to go into renaming (there are at least 3 ways to manually rename a file, and I don’t want to describe them now. If you care to know just ask).

So what did I do? Did I really bother with all of that nonsense?! NO WAY! I have no patience for that!

Here’s the easy way:

1.) First, open your terminal (sorry, this is for Mac and Linux machines only, I don’t have time to convert the code to work on Windows).

2.) Next, navigate to the directory your files are in.

3.) Finally, run this command:

for dir in `ls`; do zip $dir $dir/*; mv $dir*zip $dir.cbz; done

And it’s as simple as that! All done in one easy process, just a few lines of code!

If you just want to do a batch zip, without the rename, use this code instead:

for dir in `ls`; do zip $dir $dir/*; done

I hope that helps someone out there…


Here are a few different methods to try for batch-zipping in Linux:

## zip all files and folders in current directory
zip -r "${PWD##*/}.zip" *

## zip the contents of each folder from the current directory into an archive
for x in *; do if [ -d "$x" ]; then cd "$x"; zip -r "../$x.zip" *; cd ..; fi; done

## zip each folder into an archive
for x in *; do if [ -d "$x" ]; then zip -r "$x.zip" "$x"; fi; done

## another way to batch-zip
for i in $(find ./ -type d -maxdepth 1);do zip -r9 $i.zip $i; done

## same as above only using tar instead of zip
for i in $(find ./ -type d -maxdepth 1);do tar -czvf $i.tgz $i; done

How to speed up a slow iPhone OS 4.0 upgrade.

How to speed up a slow iPhone backup (via OS X Daily)

I recently tried to update my iPhone to version 4.0 but the backup process of the update was taking FOREVER!

I assumed that the only way to speed it up was to clear out any non-vital data, such as text messages, pics, and etc. I backed up my pics to my Mac using iPhoto and deleted them form the iPhone once done. I deleted all text messages, old voicemails, and removed a bunch of apps i never use and don’t really want/need. Then I shut it down and back on again and put it in airplane mode.

Now the backup portion of the update seems to be going faster, but still horribly slow. Apparently it is doing a full backup without exception (meaning it backs EVERYTHING up even if it was backed up previously and unchanged since).

If you have any tips feel free to post them in the comments below. Otherwise all I have to offer is what I typed above and this link I found: here.


I have noticed this seems to be quite a popular post (based on the results I am seeing on StatPress), so I think it important to update you all on how everything went.

I have a friend who works in Technical Support for AT&T. She offered some extra help in figuring out the problem. To make a long story short, this is in fact a problem associated with older phone models (such as the 3G) and here is the process that worked best for me (your mileage may vary)…

What to do

Step 1: Backup your purchases to iTunes. File->Transfer Purchases from |your phone’s name here|

Step 2: Backup your photos. Since I was performing this upgrade on my Mac at work, I used iPhoto to do the backup.

Step 3: Delete all photos from your phone (don’t worry, you already backed them up in step 2 right?).

Step 4: Delete any old/unused apps from your phone. This will decrease the amount of data on your phone which will speed up the upgrade process.

Step 5: Delete any old/nonessential text messages, emails, voicemails, and etc.

Step 6: If you have a ton of music/video on your phone, as long as it is safely backed up to iTunes, go ahead and remove it from your phone.

Step 7: Put your phone in airplane mode. Settings->Airplane Mode->On (this will prevent anyone from calling/texting you which might interrupt the Sync).

Step 8: Turn Off Notifications. Settings->Notifications->Off (this will prevent your apps from sending you push notifications which could interfere with the Sync).

Step 9: Begin the Upgrade process. It should begin by doing a full backup of your iPhone, then proceed to install the new OS, then if everything goes well it will restore your data and apps to your phone.

Step 10: Turn your notifications back on and turn off airplane mode.

Other Notes

If for some reason your phone does not have the data and/or apps on it after the upgrade, first ensure that the upgrade was in fact successful. Go to Settings->General->About->Version and it should say 4.0 (followed by some numbers and/or letters in parentheses). If it says something else, restore the phone to factory settings and try again.

If your phone is upgraded to 4.0 and you are still missing your data/apps then simply re-sync your phone with iTunes and you should be all set.

Another problem people have been having is connection to the network (AT&T phone service and/or 3G/WiFi). My phone had this problem and my friend informed me that this was actually the most common complaint they had.

To fix this, simply put your phone in back in airplane mode, wait a few seconds, then turn airplane mode off again. If this doesn’t work, try powering off your phone then back on again.