Linux Command---Split

Source: Internet
Author: User

large file split command split :

The following list shows several command-line options that are most commonly used by this command:

options description
-l Specifies the number of rows, each separated into a single file, with a default value of 1000 rows.
-b Specifies the number of bytes, supported by: K and M
-c similar to the-B parameter, but as much as possible to maintain the integrity of each row when cutting
-d

/> Ls-l
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2

/> split-b 5k test.tar.bz2 #以每文件5k的大小切割test. tar.bz2
/> ls-l #查看切割后的结果, the file name is split by default in the following form.
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2
-rw-r--r--. 1 root root 5120 Nov 23:34 Xaa
-rw-r--r--. 1 root root 5120 Nov 23:34 xab
-rw-r--r--. 1 root root 290 Nov 23:34 xac

/> rm-f x*#删除拆分后的小文件
/> split-d-B 5k test.tar.bz2 #-d option to name the split small file after the suffix as a number
/> ls-l
-rw-r--r--. 1 root root 10530 Nov 23:08 test.tar.bz2
-rw-r--r--. 1 root root 5120 Nov 23:36 x00
-rw-r--r--. 1 root root 5120 Nov 23:36 x01
-rw-r--r--. 1 root root 290 Nov 23:36 x02

/> WC install.log-l #计算该文件的行数
/> split-l install.log #每300行拆分成一个小文件
/> ls-l x*
-rw-r--r--. 1 root root 11184 Nov 23:42 Xaa
-rw-r--r--. 1 root root 10805 Nov 23:42 xab
-rw-r--r--. 1 root root 12340 Nov 23:42 xac
-rw-r--r--. 1 root root 11783 Nov 23:42 xad
-rw-r--r--. 1 root root 2105 Nov 23:42 xae

Linux Command---Split

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.