Centos large file cutting and merging, centos cutting and merging

Source: Internet
Author: User

Centos large file cutting and merging, centos cutting and merging

Many companies now place projects on ECS. When I want to put down the code and generated file "sz file name" in the ECS, I find it too large. ECS does not support downloading large files. In this case, you need to use the split command to cut the file, then go down, merge it locally or upload it to the desired server, and then merge it.

The split command syntax is as follows:

Split [--help] [-version] [-a] [-B] [-C] [-l] [file to be cut] [output file name prefix]

-A,--suffix-length = N: used suffix length (2 by default)
-B,--bytes = SIZE: the SIZE of each output file in bytes.
-C,--line-bytes = SIZE: maximum SIZE of each output file in each row
-D,--numeric-suffixes: Use a numeric suffix instead of a letter suffix
-L,--lines = NUMBER: set the NUMBER of lines for each output file
--Help: displays help information.
--Version: displays version information.
++ Ps: there is no space in the "-" section before all commands in the article, it's just to demonstrate the obvious ++

The following is a simple test:


We can see that four files are generated using the "split-B 3 m tomcat.tar.gz _" command, each of which is 3 MB in size.
In this way, you can use the "sz" command to download the cut files on the ECS.

After downloading the cut file, you can merge it locally in the windows system before uploading it, or upload the cut file to the linux System for merging.

1. Merging in windows:

We can see that the file is still cut.
Copy/B tomcat.tar.gz_aa+tomctomcat.tar.gz_ AB +tomctomcat.tar.gz_ac+tomcat.tar.gz _ ad test.tar.gz to merge the file test.tar.gz.

2. Merge in linux:

You can use a simple "cat all the names of cut files> New file names" command to merge the cut files.

++ ++
We use md5 verification to check whether the two files are the same:
Files before splitting:

Md5 value: 080075877a66adf52b7f6d0013fa9730

++ ++
Files merged in windows after splitting:

Md5 value: 080075877a66adf52b7f6d0013fa9730

++ ++

Files merged in linux after splitting:

Md5 value: 080075877a66adf52b7f6d0013fa9730

Copyright statement: This article is not necessarily the original author of the blog, but not allowed by the blog can not be reproduced, reprint also don't let me see, the eyes of the http://blog.csdn.net/leo15561050003/article/details/79130618

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.