Linux split command (dividing a large file into several small files based on the number of rows)

Source: Internet
Author: User

How to divide a large file into several small files

For example, you can divide a blm.txt file into 1000 small files prefixed with BLM _. The suffix is in the form of coefficients and the suffix is in the form of four digits.

First use

WC-l blm.txt reads the total number of lines in the blm.txt File

Use the split command

Split-l 2482 ../BLM/blm.txt-D-A 4 BLM _

The blm.txt file is divided into several small files. Each file contains 2482 rows (-l 2482) with the prefix BLM _. The coefficient is not a letter but a number (-D ), suffix coefficient is four digits (-a 4)

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.