Split and merge files in linux

Source: Internet
Author: User
Split files and merge files in linux-general Linux technology-Linux technology and application information. For more information, see the following. Split files using split
Usage: split [Option]... [file]
Split the input content into fixed-size parts and output them <前缀aa> , <前缀ab> ,...;
The default unit is 1000. The default unit is. <前缀> Is "x ". If you do not specify <文件> , Or
By <文件> -, The program reads data from the standard input.

Long Options are required when short options are used.
-A, -- suffix-length = N specify the suffix length (2 by default)
-B, -- bytes = size specifies the bytes of each output file <大小>
-C, -- line-bytes = size specifies the maximum row of bytes in each output file <大小>
-D, -- numeric-suffixes use the numeric suffix instead of the letter suffix
-L, -- lines = value specifies the number of rows in each output file.
-- Verbose displays detailed information on standard errors before opening each output file
-- Help: displays the help information and leaves
-- Version: displays the version information and leaves.

<大小> The value-added suffix can be included: B Indicates 512; k indicates 1 K; m indicates 1 Meg.

For example, after split-l10000 xx. file is split, each file contains 10 thousand lines.

Use cat to merge files
Cat file_a file_ B> file_c

In this way, the file_a and file_ B files can be merged into file_c.

Cat usage:

Usage: cat [Option] file...
Set <文件> Or the standard input is serialized to the standard output.

-A, -- show-all is equivalent to-vET.
-B, -- number-nonblank: number of non-empty output rows
-E is equivalent to-vE.
-E, -- show-ends is displayed at the end of each line $
-N, -- number indicates the number of all rows output.
-S, -- squeeze-blank does not output consecutive empty rows
-T is equivalent to-vT.
-T, -- show-tabs displays the tab as ^ I
-U (ignore)
-V, -- show-nonprinting use the ^ and M-controllers, except for LFD and TAB.
-- Help: displays the help information and leaves
-- Version: displays the version information and leaves.

If you do not know <文件> , Or <文件> -, The program reads data from the standard input.

Example:
Cat f-g first outputs the content of f, then outputs the content of standard input, and finally outputs the content of g.
Cat copies the content of the standard input to the standard output.
Related Article

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.