The character of the Linux command in the--split command

Source: Internet
Author: User

Location:/usr/bin/split

Permissions: All Users

Role:

Usage: split [OPTION] ... [INPUT [PREFIX]]

Options:

-B can then be cut to the size of the file, you can add units, for example: B,k, M

-L split by number of rows

PREFIX: Leader character, which can be used as a leading text for a cut file


Here col1 is a leader, generating 3 files COL1AA, Col1ab, COL1AC

$ split-b 1k Col col1$ ls-hl Total usage 80k-rw-rw-r--1 cwjy1202 cwjy1202   541 months  8 00:11 a-rw-rw-r--1 cwjy1202 cwjy1202< c2/>39 January 12:58 b-rw-rw-r--1 cwjy1202 cwjy1202   541 months  8 22:09 c-rw-rw-r--1 cwjy1202 cwjy1202 3.0K January 11 18:50 col-rw-rw-r--1 cwjy1202 cwjy1202 1.0K January 00:09 col1aa-rw-rw-r--1 cwjy1202 cwjy1202 1.0K January 00:09 col1ab-rw-rw-r-- 1 cwjy1202 cwjy1202 10,061 month 00:09 col1ac-rw-rw-r--1 cwjy1202 cwjy1202 3.0K January 18:45 col.list-rw-rw-r--1 cwjy1202 C  wjy1202   977 22:09 mudidrwxr-xr-x 2 cwjy1202 cwjy1202 4.0K 239 23:47 mydir-rwxr-xr-x 1 cwjy1202 cwjy1202  15K 238 23:20 nginx-rw-rw-r--1 cwjy1202 cwjy1202  16K 237 20:16 nginxlog-rw-------1 cwjy1202 cwjy1202 10,048 months 29 17: The R language is a flowchart. r-rw-rw-r--1 cwjy1202 cwjy1202   331 months  3 16:13 TEST.BC


The file col is delimited by the number of rows, and the resulting file leader is Col, divided into three files Colaa, Colab, Colac, and Colad

$ split-l Col col$ ls-hl Total dosage 84k-rw-rw-r--1 cwjy1202 cwjy1202   541 months  8 00:11 a-rw-rw-r--1 cwjy1202 cwjy1202
   39 January 12:58 b-rw-rw-r--1 cwjy1202 cwjy1202   541 months  8 22:09 c-rw-rw-r--1 cwjy1202 cwjy1202 3.0K January one 18:50 C ol-rw-rw-r--1 cwjy1202 cwjy1202  9,211 month 00:13 colaa-rw-rw-r--1 cwjy1202 cwjy1202 10,211 months 00:13 colab-rw-rw-r--  1 cwjy1202 cwjy1202  8,071 months 00:13 colac-rw-rw-r--1 cwjy1202 cwjy1202  3,051 months 00:13 colad-rw-rw-r--1 cwjy1202 cwjy1202 3.0K January 18:45 col.list-rw-rw-r--1 cwjy1202 cwjy1202   977 22:09 mudidrwxr-xr-x 2 cwjy1202 cwjy1202 4. 0K 239 23:47 mydir-rwxr-xr-x 1 cwjy1202 cwjy1202  15K 238 23:20 nginx-rw-rw-r--1 cwjy1202 cwjy1202  16K 237 20:16 nginxlog-rw-------1 cwjy1202 cwjy1202 10,048 months 17:24 R language to do flowchart. r-rw-rw-r--1 cwjy1202 cwjy1202   331 months  3 16 : TEST.BC

Special Example: How to separate the following information into multiple files in 5 rows

$ ls-al Total dosage 92drwxrwxr-x  3 cwjy1202 cwjy1202  40,961 months 00:19. drwxrwxr-x cwjy1202 cwjy1202  41,187 21: 23.. -rw-rw-r--  1 cwjy1202 cwjy1202    541 months  8 00:11 a-rw-rw-r--  1 cwjy1202 cwjy1202    391 months 12:58 b-rw-rw-r --  1 cwjy1202 cwjy1202    541 months  8 22:09 c-rw-rw-r--  1 cwjy1202 cwjy1202  30,541 months 18:50 col-rw-rw-r- -  1 cwjy1202 cwjy1202   9,211 months 00:13 colaa-rw-rw-r--  1 cwjy1202 cwjy1202  10,211 months 00:13 COLAB-RW-RW -r--  1 cwjy1202 cwjy1202   8,071 month 00:13 colac-rw-rw-r--  1 cwjy1202 cwjy1202   3,051 months 00:13 colad-rw- rw-r--  1 cwjy1202 cwjy1202  30,541 months 18:45 col.list-rw-rw-r--  1 cwjy1202 cwjy1202    977 22:09 Mudi Drwxr-xr-x  2 cwjy1202 cwjy1202  41,189 23:47 mydir-rwxr-xr-x  1 cwjy1202 cwjy1202 147,208 23:20 nginx -rw-rw-r--  1 cwjy1202 cwjy1202 163,207 20:16 nginxlog-rw-------  1 cwjy1202 cwjy1202  10,048 months 17:24 R Make a flowchart. r-rw-rw-r--  1 cwjy1202 cwjy1202    331 months  3 16:13 TEST.BC

as follows: Split-l 5---, that--indicates the need for stdout or stdin

In addition, Lsal represents the name leader of the generated file, generated by the name: Lsalaa,Lsalab,Lsalac,lsalad

$ ls-la| Split-l 5-lsal$ ls-al Total dosage 108drwxrwxr-x 3 cwjy1202 cwjy1202 40,961 months 00:21. drwxrwxr-x cwjy1202 cwjy1202 40,960 227 21:23.. -rw-rw-r--1 cwjy1202 cwjy1202 541 months 8 00:11 a-rw-rw-r--1 cwjy1202 cwjy1202 391 months 12:58 b-rw-rw-r--1 cwjy12 cwjy1202 541 months 8 22:09 c-rw-rw-r--1 cwjy1202 cwjy1202 30,541 months 18:50 col-rw-rw-r--1 cwjy1202 cwjy1202 921 January 00:13 colaa-rw-rw-r--1 cwjy1202 cwjy1202 10,211 months 00:13 colab-rw-rw-r--1 cwjy1202 cwjy1202 8,071 months 12 00:13 colac-rw-rw-r--1 cwjy1202 cwjy1202 3,051 month 00:13 colad-rw-rw-r--1 cwjy1202 cwjy1202 30,541 months 18:45 col.list-rw- rw-r--1 cwjy1202 cwjy1202 2,381 months 00:21 lsalaa-rw-rw-r--1 cwjy1202 cwjy1202 2,941 months 00:21 lsalab-rw-rw-r--1 cwjy1202 cwjy1202 3,021 months 00:21 lsalac-rw-rw-r--1 cwjy1202 cwjy1202 2011 months 00:21 lsalad-rw-rw-r--1 cwjy1202 C  wjy1202 977 22:09 mudidrwxr-xr-x 2 cwjy1202 cwjy1202 41,189 23:47 mydir-rwxr-xr-x 1 cwjy1202 cwjy1202 14698238 23:20 nginx-rw-rw-r--1 cwjy1202 cwjy1202 163,207 20:16 nginxlog-rw-------1 cwjy1202 cwjy1202 10,048 months 29 17: The R language is a flowchart. r-rw-rw-r--1 cwjy1202 cwjy1202 331 months 3 16:13 TEST.BC

$ wc-l lsal*   5 lsalaa   5 lsalab   5 Lsalac   3 Lsalad  18 total consumption




The character of the Linux command in the--split command

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.