补充切分文件和合并文件指令.
Signed-off-by: ithink.chan <chenyang@autoai.com>
This commit is contained in:
parent
39337c64d3
commit
46531b9575
|
@ -0,0 +1,9 @@
|
|||
# Cat 合并文件
|
||||
|
||||
```sh
|
||||
cat <input file 1> <input file 2> <input file...> <input file n> > <output file>
|
||||
# 或者
|
||||
cat <input file prefix>* > <output file>
|
||||
```
|
||||
|
||||
切分文件方法参见 [《Split 切分文件》](../Split/Split_切分文件.md)
|
|
@ -0,0 +1,31 @@
|
|||
# Split 切分文件
|
||||
|
||||
当面临将一个大文件进行切分时,linux 的 split 命令是很好的选择。它包含多种参数,支持按行、大小进行切分。
|
||||
|
||||
split 命令的语法如下:
|
||||
|
||||
```sh
|
||||
split [--help][--version][-a ][-b][-C ][-d][-l ] <input file> <output file prefix>
|
||||
```
|
||||
|
||||
## 按行数分割
|
||||
|
||||
```sh
|
||||
split -l 300 <input file> <output file prefix>
|
||||
```
|
||||
|
||||
加上 -d,使用数字后缀;加上 --verbose,显示分割进度:
|
||||
|
||||
```sh
|
||||
split --verbose -l50000 -d <input file> <output file prefix>
|
||||
```
|
||||
|
||||
## 按字节大小分割
|
||||
|
||||
```sh
|
||||
split -b 10m <input file> <output file prefix>
|
||||
```
|
||||
|
||||
## 合并文件
|
||||
|
||||
参见 [《Cat 合并文件》](../Cat/Cat_合并文件.md)
|
Loading…
Reference in New Issue