Bạn đã xem lệnh chia tách chưa?
$ split --help
Usage: split [OPTION] [INPUT [PREFIX]]
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 to standard error just
before each output file is opened
--help display this help and exit
--version output version information and exit
Bạn có thể làm một cái gì đó như thế này:
split -l 200000 filename
mà sẽ tạo ra các file mỗi 200000 dòng tên xaa xab xac
...
Một tùy chọn khác, chia theo kích thước của tập tin đầu ra (vẫn còn chia rẽ trên ngắt dòng):
split -C 20m --numeric-suffixes input_filename output_prefix
tạo tệp như output_prefix01 output_prefix02 output_prefix03 ...
mỗi kích thước tối đa 20 megabyte.
Nguồn
2010-01-06 22:44:37
Out of tò mò, sau khi họ đang "chia tay", làm thế nào để "kết hợp" họ? Một cái gì đó như "mèo part2 >> part1"? Hay là có một tiện ích ninja khác? nhớ cập nhật câu hỏi của bạn? – dlamotte
Để đặt nó lại với nhau, 'cat part *> original' –
có con mèo là viết tắt của concatenate. Nói chung apropos rất hữu ích cho việc tìm kiếm các lệnh thích hợp. I E. xem đầu ra của: apropos split – pixelbeat