Mac Terminal Zip Multiple Files

Break up huge files into manageable chunks so that they can be uploaded and opened in Excel.

With the recent news that Windows 10 will introduce a UNIX shell, users will have access to a command-line environment on Linux, Mac, and Windows for the first time. And that means you can finally stop bugging the developers at your company to break up the enormous files that Microsoft Excel refuses to open. You don’t need to know anything about the Terminal to do this; although, if you’d like to learn more, check out these tutorials:

Okay, here’s how it works (for this article, we’ll be working on a Mac, but you can use this method elsewhere).

FilesMac Terminal Zip Multiple Files
  1. Open Terminal (Applications/Utilities/Terminal)
  2. Create a new folder on your desktop. This is where you’ll save the file that needs to be split. My folder is called ‘split’ and I have a CSV file that contains a few copies of the English dictionary, or about 2.36 million rows.
  3. In Terminal, navigate to the folder you just created using the ‘cd’ command, which stands for ‘change directory.’
  4. Now, you’ll use the ‘split’ command to break the original file into smaller files. To do this, you’ll type the following, where 250000 is the incremental number of rows at which you want the files to break.

    You can see that the new files are way smaller and have been named in a series of three letters, beginning with ‘xaa.’ These are still CSV files – they just don’t have the ‘.csv’ file extension yet. You can add it manually, but if you have a lot of new files it’s easier to do it through the Terminal.

  5. Make sure that you’re still in the ‘Split’ folder on your desktop using the ‘pwd’ (print working directory) command. Next, paste the following – no need to worry about how it works.
    for i in *; do mv '$i' '$i.csv'; done

    You should now see that all of the split files are saved as comma-separated and will open nicely in Excel.

Mac Terminal Zip Multiple Files

Interested in working with us?See our open engineering roles here.

Mac terminal zip multiple files batch

Zip Multiple Files Windows

Multiple

Mac Terminal Zip Multiple Files In Adobe Indesign

In the drop-down menu that appears, click on 'Compress.' A zip file will be created in the same directory as the original folder. How to Zip Files Using Mac Terminal. You can Zip your files in Mac's Terminal in different ways, but the simplest method will be outlined here for you. Open up a Finder window. In the drop-down menu that appears, click on 'Compress.' A zip file will be created in the same directory as the original folder. How to Zip Files Using Mac Terminal. You can Zip your files in Mac's Terminal in different ways, but the simplest method will be outlined here for you. Open up a Finder window. To delete all the files and sub-folders in a directory named 'oldfolder,' the command is rm -R oldfolder and to confirm each file should be deleted, rm -iR oldfolder. Just because you can use Terminal to delete files on your Mac doesn’t mean you should. It’s a relatively blunt instrument, deleting only those files and folders you specify. A new folder will be created, and you can find all the unzipped files there. To open tar file on Mac using command line, open Terminal. Type syntax like this: tar xvzf desktoparchive.tar.gz. To find the extracted files, open Finder and go to the toolbar at the top of your screen. Use the -s switch on the zip command in terminal. So if your folder was called FolderName. Zip -r -s 64 archive.zip FolderName/. 64 is the size of the split (in this case 64Mb). Use -s to set the split size and create a split archive. The size is given as a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB) (the default is m).