Splitting and merging large files in Linux
In some cases you won't be able to transfer very large files using storage devices. So the best way is to use split a given file in to arbitrary no of volumes at the source and them merge at the destination.
This will simply do that for you.
Then you can split it using split command and as a parameter you can give the size of a each volume. (here its 25MB)
Now you can untar this and use the original file/directory.
This will simply do that for you.
Splitting
Say you have a directory/file called 'foo'. First you need to create a '.tar.gz'.
tar -cvzf foo.tar.gz foo
Then you can split it using split command and as a parameter you can give the size of a each volume. (here its 25MB)
split -d -b25m foo.tar.gz foo.tar.gz.
Merge
Simply you can merger using the cat command.
cat foo.tar.gz.0* >foo.tar.gz
Now you can untar this and use the original file/directory.
Comentários
Postar um comentário