免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 852 | 回复: 0
打印 上一主题 下一主题

Linux / Unix split command [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-13 09:33 |只看该作者 |倒序浏览

Quick links
About split
Syntax
Examples

Related commands

Linux / Unix main page
About split
Split a file into pieces.
Syntax
split [-linecount | -l linecount ] [ -a suffixlength ] [file [name] ]
split -b n [k | m] [ -a suffixlength ] [ file [name]]
-linecount | -l linecount
Number of lines in each piece. Defaults to 1000 lines.
-a suffixlength
Use suffixlength letters to form the suffix portion of the filenames of the split file. If -a is not specified, the default suffix length is 2. If the sum of the name operand and the suffixlength option-argument would create a filename exceeding NAME_MAX bytes, an error will result; split will exit with a diagnostic message and no files will be created.
-b n
Split a file into pieces n bytes in size.
-b n k
Split a file into pieces n*1024 bytes in size.
-b n m
Split a file into pieces n*1048576 bytes in size.
file
The path name of the ordinary file to be split. If no input file is given or file is -, the standard input will be used.
name
The prefix to be used for each of the files resulting from the split operation. If no name argument is given, x will be used as the prefix of the output files. The combined length of the basename of prefix and suffixlength cannot exceed NAME_MAX bytes; see OPTIONS.
Examples
split -b 22 newfile.txt new - would split the file "newfile.txt" into three separate files called newaa, newab and newac each file the size of 22.
split -l 300 file.txt new - would split the file "newfile.txt" into files beginning with the name "new" each containing 300 lines of text each


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/55091/showart_1926559.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP