Linux Split and optimization

Source: Internet
Author: User


Split is not good to use, but it can be used for a while!

There are two ways to split, press a fixed number of rows, and press a fixed size. The default is 1000 lines, suffix length is 2, suffix length n is said, the Shard from the minimum value of n letters/numbers to its maximum value

#split--h
Usage: Split [options] ... [input [prefix]]
Split the input into fixed-size shards and output to prefix AA, prefix ab,... ;
The default is split units with 1000 behavior, and the default prefix is "x". If you do not specify a file, or
If the user file is "-", the data is read from the standard input.

The long option must use parameters that are also required for short options.
-A,--suffix-length=n specifies a suffix length of N (default = 2)
-B,--bytes= size specifies the byte size of each output file
-C,--line-bytes= size specifies the maximum row byte size in each output file
-D,--numeric-suffixes uses a numeric suffix instead of a letter suffix
-L,--lines= value specifies how many rows each output file has
--verbose output file characteristics before each output file is opened
--HELP Display this help message and exit
--version display version information and exit


The SIZE can be an optional integer followed by one of the following units:
KB 1000,k 1024,mb 1000*1000,m 1024*1024, also G, T, P, E, Z, Y.

To test the next
split-l10000 Catalina.out
#ls
Catalina.out xae xaj xao xat xay xbd xbi xbn xbs xbx xcc xch xcm xcr xcw xdb xdg xdl xdq XDV
Xaa xaf Xak xap xau xaz xbe xbj xbo xbt xby xcd xci xcn xcs xcx xdc xdh xdm XDR XDW
Xab xag xal xaq xav xba xbf xbk xbp xbu xbz xce xcj xco xct xcy xdd xdi xdn XDS
Xac xah xam xar xaw xbb xbg xbl xbq xbv xca xcf xck xcp xcu xcz xde xdj xdo xdt
Xad Xai Xan Xas xax xbc xbh xbm xbr xbw xcb xcg xcl xcq xcv xda xdf XDK XDP Xdu

rm/tt/x*


#split-l1000 Catalina.out
Split: The output file suffix has been excluded-indicates that only files that meet the suffix are removed and filtered! The default suffix is length 2, which shows only aa-zz 26*26 files

#lscatalina. out XBC xcf xdi xel xfo xgr xhu xix xka xld xmg xnj xom xpp xqs xrv xsy xub XVe xwh xxk xyn xzqxaa xbd xcg xdj xem xfp xgs XH V xiy xkb xle xmh xnk xon xpq xqt xrw xsz xuc xvf xwi XXL xyo xzrxab xbe xch XDK Xen xfq xgt xhw xiz xkc xlf xmi xnl xoo x PR xqu xrx xta xud xvg xwj xxm xyp xzsxac xbf xci xdl xeo xfr xgu xhx xja xkd xlg xmj xnm xop xps xqv xry xtb xue XVH xwk Xxn xyq xztxad xbg xcj xdm xep xfs xgv xhy xjb xke xlh xmk xnn xoq xpt xqw xrz xtc xuf xvi xwl xxo xyr xzuxae xbh xck xdn  XEQ xft XGW xhz xjc xkf xli XML xno xor xpu xqx xsa xtd xug xvj xwm xxp xys xzvxaf xbi xcl xdo xer xfu xgx xia xjd xkg xlj XMM xnp xos XPV xqy xsb xte xuh xvk xwn xxq xyt xzwxag xbj xcm xdp xes xfv xgy xib xje xkh xlk xmn xnq xot XPW xqz XSC xt F xui xvl xwo xxr xyu xzxxah xbk xcn xdq xet xfw xgz xic xjf xki xll xmo xnr xou xpx xra xsd xtg xuj xvm xwp xxs xyv xzyxa I XBL Xco xdr xeu xfx xha xid xjg xkj xlm xmp xns xov xpy xrb xse xth xuk xvn xwq xxt xyw xzzxaj xbm xcp xds xev xfy XHB x IE xjh XKK xln xmq xnt xow xpz xrc xsf xti xul xvo xwr xxu xyxxak xbn xcq xdt xew xfz xhc xif xji xkl xlo xmr xnu XOX xqa xrd xsg xtj xum XVP xws XXV xyyxal Xbo xcr xdu xex XGA xhd xig xjj xkm xlp xms xnv xoy xqb xre xsh xtk Xun xvq xwt xxw xyzxam xbp xcs xdv Xey XGB  Xhe xih xjk xkn xlq xmt xnw xoz xqc XRF xsi xtl xuo xvr xwu xxx xzaxan xbq xct xdw xez XGC xhf xii xjl xko XLR xmu xnx XPA XQD xrg xsj xtm xup XVs xwv xxy xzbxao xbr xcu xdx xfa xgd xhg xij xjm xkp xls xmv xny xpb xqe xrh xsk xtn xuq xvt xww xx Z xzcxap xbs xcv xdy xfb xge xhh xik xjn xkq xlt xmw xnz xpc xqf xri xsl xto xur xvu xwx xya xzdxaq xbt xcw xdz xfc xgf XH I xil xjo xkr xlu xmx xoa xpd xqg xrj xsm xtp xus xvv xwy xyb xzexar xbu xcx xea XfD xgg xhj xim xjp xks xlv xmy xob xpe x QH xrk xsn xtq xut xvw xwz xyc xzfxas xbv xcy xeb xfe xgh xhk xin xjq xkt xlw xmz xoc xpf xqi xrl xso xtr xuu xvx xxa xyd Xzgxat XBW xcz xec xff xgi xhl xio xjr xku xlx XNA Xod xpg xqj xrm xsp xts xuv xvy xxb xye xzhxau xbx xda xed xfg xgj xhm XIP XJS xkv xly xnb XoeXph xqk xrn xsq xtt xuw xvz xxc xyf xzixav xby xdb xee xfh xgk xhn xiq xjt xkw xlz xnc xof xpi xql xro xsr xtu xux xwa xxd  Xyg xzjxaw xbz xdc xef xfi xgl xho xir xju xkx xma xnd xog xpj xqm xrp xss xtv xuy xwb XXe xyh xzkxax xca xdd xeg xfj xgm XHP XIs xjv xky xmb xne xoh xpk xqn xrq xst xtw xuz xwc xxf xyi xzlxay xcb xde xeh xfk xgn xhq xit xjw xkz xmc xnf xoi XP L XQO xrr xsu xtx xva xwd xxg xyj xzmxaz xcc xdf xei xfl xgo xhr Xiu xjx xla xmd xng xoj xpm xqp xrs xsv xty xvb xwe xxh x YK xznxba xcd xdg xej xfm xgp xhs xiv xjy xlb xme xnh xok xpn xqq xrt xsw xtz xvc xwf XXI xyl xzoxbb xce xdh xek xfn xgq x HT XIW XJZ xlc xmf xni xol xpo xqr xru xsx xua xvd xwg xxj xym xzp


Remove the excluded output file suffix, you need to change the prefix length,
You can use SPLIT-L1000-A4 catalina.out


Display with numbers:
rm/py/log/x*
#split-l100000-d Catalina.out
#ls
Catalina.out x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 x10


The disadvantage is that you can set the prefix, but cannot set the suffix, ———— this is not the pit father?? Why is there such a low limit??


Oh, my God!! Search all the forums/StackOverflow have no answer! I wipe, everybody don't want this??

No, write one yourself!

vi batchaddsuffix.shecho prefix cant be empty!fiecho prefix cant be empty!prefix=$1suffix=$2if[-Z $1 ]; then echo prefix cant is empty!Exit-1fiif[-Z $2 ]; Thenecho suffix cant be empty!Exit-1Fiarr= ' ls ${prefix}*| Cut-d" "-F1 ' forFfinch$arr DoEcho Moving $ff to $ff ${suffix}mv $ff $ff ${suffix}done

Linux Split and optimization

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.