"Linux" Split command split

Source: Internet
Author: User
Tags stdin

If you have the file too big, cause some portable device can't copy the problem, hey! It's right to find split! He can help you. You can divide a large file into small files by dividing it by file size or number of rows. Fast and effective! Really good ~

[Email protected] ~]#Split[-BL]fileprefix options and parameters:-B: The following can be divided into the file size, can be added units, such as B, K, m, etc.;-L: Split by number of rows. PREFIX: Represents the leader character and can be used as the leading text for the split file. Example one: my/etc/termcap have more than 700 k, if you want to be divided into 300K a file? [[Email protected]~]# cd/tmp;Split-B 300k/etc/termcap Termcap[[email protected] tmp]# ll-K termcap*-rw-r--r--1Root root -Feb7  -: theTERMCAPAA-rw-r--r--1Root root -Feb7  -: thetermcapab-rw-r--r--1Root root189Feb7  -: thetermcapac# that file name is free to take! We just write the preamble, small files will be # Xxxaa, Xxxab, Xxxac and other ways to create small files! Example two: How to synthesize the three small files above a file named Termcapback[[email protected] tmp]#Cattermcap* >>termcapback# is simple, isn't it? Just use the data flow redirection. Simple! Example three: Usingls-al/output information, every 10 lines are recorded as one file [[email protected] tmp]#ls-al/|Split-LTen-Lsroot[[email protected] tmp]#WC-L lsroot*TenLsrootaaTenLsrootab6Lsrootac -total# focus on that-Now! In general, if you need stdout/stdin, but there is no document, # some just-When, then that-will be treated as stdin or stdout ~

What do you need to do to split a file under the Windows operating system? It's a headache! It's a lot easier under Linux! If you want to split the file, then use the-B size to limit the size of a segmented file, and if it is the number of rows, then use the-L line to split it! Good use of it! In this way, you can easily partition your files into a floppy disk (floppy) size, convenient for you to copy!

  Reference:http://vbird.dic.ksu.edu.tw/linux_basic/0320bash.php#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.