How to split a large file into several smaller ones using Terminal on Mac

2023-07-15 18:00:00

We have already taught you how very simple it is to use the Terminal to perform various tasks on your Mac.

Among the most recent examples are the possibility of checking your download history, command history and even executing a shortcut directly from that command line.

Today, we are going to show you how split a file in several smaller sizes—ideal for when you want to send an oversized file in an email or to put it on two external storage drives, for example.

Check out the step-by-step below! ????‍????

Open Terminal. This can be done using Spotlight search, Launchpad, Siri, or by opening Finder and going to the /Applications/Utilities folder. Go, through the Terminal, to the folder where the file you want to divide is located. A good tip is to type cd, give it a space, and drag the folder from the Finder into the Terminal window — that way, it fills in the folder path just right for you. Use the following command to split the file: split -b size[K|k|M|m|G|g] [arquivo] [prefixo]

In place of size, you must enter the size of the split files you want to generate. For 20GB, for example, use 20G; for 200MB, use 200M; and so on. To insert the file itself (i.e. the big one you want to split), replace [arquivo] along its path in Finder. You can do this by momentarily holding down the ⌥ option key after selecting the file, going to View » Show Path Bar (on the menu bar after selecting it) or using ⌥ ⌘ command P. Then, click on this path and drag it to the Terminal area. Finally, replace [prefixo] by the path where you want the divided files to be saved on the Mac, putting the name that will come before the split files. Each split file will end in aa, ab, ac, ad, and so on.

In the example below, a large file was divided into two and, for that, I used the prefix videosnovos.mp4. — yes, with a period at the end:

It may seem a little complicated, but once you get the hang of it, it can be very useful in certain cases. ????

via iClarified

1689446115
#split #large #file #smaller #Terminal #Mac

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.