Last active
November 10, 2018 00:43
-
-
Save ChrisCinelli/f372134e85a4f3373af972e14df58458 to your computer and use it in GitHub Desktop.
Split a file in pieces of 10Mb that can be easily reassembled with 'cat'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Split files in a bunch of 10Mb files and add .zip (even if they are not zip) | |
# Why? They can be attached to a issue in Github and overcoming the ;-) | |
# Use: split10m file | |
# or tar cJf - folder_to_compress | split10m | |
gsplit -b 10m -d --additional-suffix=.zip ${1:--} ${2:-archive} | |
# It can be reconstructed with just: | |
# $ cat archive*.zip > originalfile | |
# Or assuming that the file was a .tar.xz file, it can be extract directly: | |
# $ cat archive*.zip | tar PxJf - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment