linux 将文件分成两部分,linux 将大文件分成小文件
最近lvm磁盘老报错,message文件大的惊人,想找个办法将这个文件分成若干的小文件来查看。无意中发现这个神器-----split
例如将一个message文件分成前缀为message_ 的100个小文件,后缀为系数形式,且后缀为4位数字形式
先利用
wc -l message 获得message 文件一共有多少行
然后将结果除以100记过大概是81114;
然后用 split 命令
split -l 81114 messages messages_
将 文件message分成若干个小文件,每个文件81114 行(-l 81114 ),文件前缀为mesage_,系数不是字母而是数字(-d),后缀系数为四位数(-a 4)
SPLIT(1) User Commands SPLIT(1)
NAME
split - split a file into pieces
SYNOPSIS
split [OPTION]... [INPUT [PREFIX]]
DESCRIPTION
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and
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
-d, --numeric-suffixes
use numeric suffixes instead of alphabetic
-l, --lines=NUMBER
put NUMBER lines per output file
--verbose
print a diagnostic just before each output file is opened
--help display this help and exit
--version
output version information and exit
SIZE may be (or may be an integer optionally followed by) one of following: KB 1000, K 1024, MB
1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
AUTHOR
Written by Torbjorn Granlund and Richard M. Stallman.
REPORTING BUGS
Report split bugs to bug-coreutils@gnu.org
GNU coreutils home page:
General help using GNU software:
Report split translation bugs to
COPYRIGHT
Copyright 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.
SEE ALSO
The full documentation for split is maintained as a Texinfo manual. If the info and split pro-
grams are properly installed at your site, the command
info coreutils 'split invocation'
should give you access to the complete manual.
linux 将文件分成两部分,linux 将大文件分成小文件相关推荐
- 代达罗斯之殇-大数据领域小文件问题解决攻略
: 点击上方蓝色字体,选择"设为星标" 回复"资源"获取更多惊喜 大数据技术与架构 点击右侧关注,大数据开发领域最强公众号! 大数据真好玩 点击右侧关注,大数据 ...
- 一张表格分成两页打印_表格被分成两页怎么处理
大家好,我是时间财富网智能客服时间君,上述问题将由我为大家进行解答. 表格被分成两页的处理方法如下: 1.可以通过设置页边距来调整,点击打开窗口中的"页面布局"菜单. 2.在打开的 ...
- Linux截取字符串最后两位,linux的string操作(字符串截取,长度计算)
按指定的字符串截取 1.第一种方法: ${varible##*string} 从左向右截取最后一个string后的字符串 ${varible#*string}从左向右截取第一个string后的字符串 ...
- 在线查看office文件的两种方法word、excel、ppt文件
目录 一.word.excel.ppt文件在线预览 二.word.excel文件转HTML 1. 使用office软件自带功能转换HTML 2. 使用文件转换API(如Zamzar)转换HTML 一. ...
- java文件拷贝时 buff给多大合适_Java复制文件
public static void copyFile(File sourceFile, File targetFile){ try { //新建文件输入流并对它进行缓冲 FileInputStrea ...
- 两台linux之间传输文件的方法
scp传输 当两台Linux主机之间要互传文件时可使用SCP命令来实现 scp传输速度较慢,但使用ssh通道保证了传输的安全性 复制文件 将本地文件拷贝到远程 scp 文件名 –用户名@计算机IP或者 ...
- 两台Linux系统之间传输文件的几种方法
scp传输 当两台LINUX主机之间要互传文件时可使用SCP命令来实现 scp传输速度较慢,但使用ssh通道保证了传输的安全性 复制文件 将本地文件拷贝到远程 scp 文件名 –用户名@计算机IP或者 ...
- linux系统个安装360压缩,linux下的各种压缩文件安装介绍
linux的文件分两种类型,一种是普通文件,一种是目录文件,我们从网上下载的linux文件一般有这么几种:.tar.gz..tar.bz2..rpm..deb..rar..zip..pl..py..r ...
- linux下安装两个nginx教程,在linux系统下安装两个nginx的简单方法
在linux系统下安装两个nginx的简单方法 发布时间:2017-03-09 12:08 来源:互联网 当前栏目:web技术类 在linux下安装nginx的时候,一般在./configure的阶段 ...
最新文章
- Pass Infrastructure基础架构(上)
- js控制使div自动适应居中
- nRF51822之BootLoader
- C++ primer第六章6.5函数的学习 之特殊用途的语言特性
- 有重复数字的组合问题_带数字重复的组合和问题
- ffmpeg 视频的剪切
- java多线程-CountDownLatch
- 动态规划解决分割问题
- HBase region的split过程浅析
- hmtl--textarea的滚动条(转)
- 游戏开发之编程语言5选和游戏引擎3选
- ORACLE 商业收费标准
- springboot项目启动后执行方法
- Ant Design + React 中将分页组件的英文转为中文
- 【阿里云云计算工程师ACP认证】什么是ACP
- intel英特尔无线适配器高级设置
- SyntaxError: Unexpected token u in JSON at position 1
- docker 安装jaeger
- 终于,抓到了勒索病毒作者!!
- UE4 回合游戏项目 09- 添加人物属性值