Files
tldr/pages.zh/common/split.md

20 lines
613 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 拆分
> 将文件拆分成多个部分。
> 更多信息:<https://www.gnu.org/software/coreutils/split>。
- 拆分一个文件每个拆分包含10行最后一个拆分除外
`split -l 10 {{path/to/file}}`
- 将文件拆分为5个文件。文件被拆分成每个部分大小相同最后一个拆分除外
`split -n 5 {{path/to/file}}`
- 每个拆分包含512字节的文件最后一个拆分除外使用512k表示千字节512m表示兆字节
`split -b 512 {{path/to/file}}`
- 每个拆分最多包含512字节且不拆断行
`split -C 512 {{path/to/file}}`