Linux Split split file

Source: Internet
Author: User

Introduction

Split can split a large file into multiple files of a specified size, and the split speed is very fast, splitting a 1G size file takes less than 1S of time, and if you manually perform operations on Windows, the estimate is stuck.

Options

usage:split [OPTION] ... [INPUT [PREFIX]] Outputfixed-size pieces of INPUT to Prefixaa, Prefixab, ...;defaultsize is  +Lines, anddefaultPREFIX is' X'. With no input, or when input is-, read standard input. Mandatory arguments toLongOptions are mandatory for  Shortoptions too. -A,--suffix-length=n use suffixes of length N (default 2) Specifies the suffix length of the split file-B,--bytes=size put size bytes per output file split by byte, default unit byte-C,--line-bytes=size put at bytes of lines per output file specifies the maximum size of a single row, the default unit byte-D,--numeric-suffixes use numeric suffixes instead of alphabetic with numbers as suffixes of the split file-L,--lines=numbers put number lines per output file is split by rows--verbose print a diagnostic just before each output file isopened--help Display ThisHelp and exit--version output version information and exitsize May is (or may be a integer optionally followed by) one of the following : KB +K1024x768, MB +* +M1024x768*1024x768, and so on forG, T, P, E, Z, Y. You can specify other units with a suffix report split bugs to Bug-[Email Protected]gnu coreutils home page://www.gnu.org/software/coreutils/>General HelpusingGNU Software: //www.gnu.org/gethelp/>For complete documentation, Run:info coreutils'Split Invocation'

Instance
[Email protected] test]# more TESTABCDEFG

1. Splitting according to row

Each 3 lines are split into a file, the split file name begins with a name, and a number is the suffix suffix length of 1

3 1 Name
[email protected] test]# lltotal --rw-r--r--.1Root root6Oct9  +: ANAME0-rw-r--r--.1Root root6Oct9  +: Aname1-rw-r--r--.1Root root2Oct9  +: Aname2-rw-r--r--.1Root root -Oct9  +: -Test

2. Split by Byte

Every three bytes split into a file, by default, no unit is byte, can also take units such as KB,MB, etc.

3 1 New
[Email protected] test]# ls-lNew*-rw-r--r--.1Root root3Oct9  +: -new0-rw-r--r--.1Root root3Oct9  +: -New1-rw-r--r--.1Root root3Oct9  +: -New2-rw-r--r--.1Root root3Oct9  +: -NEW3-rw-r--r--.1Root root2Oct9  +: -New4

Summary

The Spit command is useful, for example, when importing data, splitting a file into concurrent import is much faster.

Note:

pursuer.chen

Blog:http://www.cnblogs.com/chenmh

This site all the essays are original, welcome to reprint, but reprint must indicate the source of the article, and at the beginning of the article clearly give the link.

Welcome to the exchange of discussions

Linux Split split file

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.