Search This Blog

Wednesday, 31 January 2018

Split and Join Large files on Linux

When we are having a very large file or directory to be copied or transferred from one place to another, It would be good practice to create a tar file first and then split the tar into small pieces of tar which could be easily copied or transferred and then merged back as a single file in the target environment.

 First, we must compress the file with tar archiver.

Syntax: $ tar -cvzf <archive-name>.tar.gz <source_file>

example: tar -cvzf test.tar.gz /home/obiee12c/catalog

To Split:

This command file archive our folder to *.tar.gz. We can use file instead of path to folder for the argument. Then we will split up our file archive into small parts.

Syntax: $ split -b 1024M <archive-name>.tar.gz “parts-prefix”

example: $ Split -b 1024M test.tar.gz test.tar.part

-b 1024M will split the file into 1 Gigabytes size of file. The “part-prefix” will give the prefix name of our parts of file.

To Merge/Join this file, we can use cat command.

$ cat test.tar.part* > test.tar.gz

Cheers! Bose

2 comments:

What is Oracle Database Link and How to create database link (DB Link)

 https://www.oracletutorial.com/oracle-administration/oracle-create-database-link/

Recent Posts