Terminal: Compressing multiple folders

Termianl-IconYou have a directory full of important folders, and you want each one compressed separately. Doing this by hand would take waaay to much time. Of course, we can do this in terminal, and with one line of code (sweet!) so it’s easy to use.

For this we use the “Find” command built in into our computer. From there we’ll have two choices, to use compress it to a zip file for a dmg file.

Continue reading

Mac OS: Zipping with your terminal

Termianl-IconThe basic command structure for compressing a file into the zip format with the terminal is:

zip -r <destination> <source>

If you want to compress more than one folder or item:

zip -r <destination> <source1> <source2>...

The source can be a file or folder.

Unfortunately zip is not very smart when it comes to folders and it will save not only the file, but the path to the file as well. We can fix this behavior by adding just a little bit to the original command.

Continue reading