在linux系统中对文件进行分割

上一篇 / 下一篇  2007-05-24 00:00:00 / 个人分类:操作系统

经常对从数据库中SPOOL出来的数据进行分割,而以往都是要在UltraEdit中一点点的剪切、复制,一直觉得linux中应该有个命令,今天终于找到了,那就是SPLIT。


下面是帮助信息:

[root@logana opt]# 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.

使用起来也非常简单,比如:

split -l 100000 xxx.lst aaaa

表示把xxx.lst分割成每10万行一个的文件,分割后的文件使用aaaa作为前缀

使用不同的参数,也可以按照文件的大小进行分割。


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-09-07  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 1253
  • 日志数: 250
  • 建立时间: 2008-01-01
  • 更新时间: 2008-01-01

RSS订阅

Open Toolbar