How to split and merge files in Linux

Source: Internet
Author: User

# File segmentation:

Dd if = source of = target.1 bs = 1 M count = 10

Dd if = source of = target.2 bs = 1 M skip = 10

# The source file is divided into target.1 and target.2 files,

# Where target.1 is the first 10 MB of the source

# Target.2 is the part of the source minus 10 m

# Merge:

Cat target.1 target.2> othersource

# In this way, target.1 target.2 is merged into the same file othersource.

# Othersource has the same content as the original source.

# If you want to replace the values of target.1 and target.2, run the following command:

Cat target.2> othersource

# Or

Cp target.2 othersource

# Then execute

Cat target.1> othersource

# In this way, target.1 is appended to the content of target.2 in othersource.

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.