ls thefile split -b 500k !$ !$. split -b 500k !$ !$.split. !! | xargsi -t split {} ~+1/{}. -d -a 3 -b 500k/10m # space ok!
!! | split -l 1000 - tmp.split. perl -e '$lmt=30; $pre="tmp.split."; $si="aa"; foreach (1..$lmt){ print "$pre$si\n"; $si++} ' ls tmp.split.?? | doeach.pl fileh ftt0 @~cat @_@~ rm tmp.split.??
$ split --help Usage: split [OPTION] [INPUT [PREFIX]] Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, --suffix-length=N use suffixes of length N (default 2) -b, --bytes=SIZE put SIZE bytes per output file -C, --line-bytes=SIZE put at most SIZE bytes of lines per output file -l, --lines=NUMBER put NUMBER lines per output file --verbose print a diagnostic to standard error just before each output file is opened --help display this help and exit --version output version information and exit SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.
jot 30 | split -l 1 - tmp.split. $ echo tmp.split.* | fold -sw 68 tmp.split.aa tmp.split.ab tmp.split.ac tmp.split.ad tmp.split.ae tmp.split.af tmp.split.ag tmp.split.ah tmp.split.ai tmp.split.aj tmp.split.ak tmp.split.al tmp.split.am tmp.split.an tmp.split.ao tmp.split.ap tmp.split.aq tmp.split.ar tmp.split.as tmp.split.at tmp.split.au tmp.split.av tmp.split.aw tmp.split.ax tmp.split.ay tmp.split.az tmp.split.ba tmp.split.bb tmp.split.bc tmp.split.bd $ perl -e '$lmt=30; $pre="tmp.split."; $si="aa"; foreach (1..$lmt){ print "$pre$si\n"; $si++} ' | xargs | fold -sw 68 tmp.split.aa tmp.split.ab tmp.split.ac tmp.split.ad tmp.split.ae tmp.split.af tmp.split.ag tmp.split.ah tmp.split.ai tmp.split.aj tmp.split.ak tmp.split.al tmp.split.am tmp.split.an tmp.split.ao tmp.split.ap tmp.split.aq tmp.split.ar tmp.split.as tmp.split.at tmp.split.au tmp.split.av tmp.split.aw tmp.split.ax tmp.split.ay tmp.split.az tmp.split.ba tmp.split.bb tmp.split.bc tmp.split.bd
documented on: 1999.10.26