split.1 (1763B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2024-08-16
- .Dt SPLIT 1
- .Os
- .Sh NAME
- .Nm split
- .Nd split a file into chunks
- .Sh SYNOPSIS
- .Nm
- .Op Fl b Ar size | Fl l Ar lines
- .Op Fl a Ar suffix_length
- .Op Ar file
- .Op Ar name
- .Sh DESCRIPTION
- .Nm
- reads
- .Ar file
- or if unspecified standard input,
- and splits it's content into files containing at most
- .Ar size
- or
- .Ar lines .
- Each split file name is made with
- .Ar name
- followed by a base-26 (a-z) suffix of exactly
- .Ar suffix_length
- characters.
- By default, the first split suffix is "aa", then the second is "ab", and so on.
- .Sh OPTIONS
- .Bl -tag -width Ds
- .It Fl a Ar suffix_length
- (Default: 2) Set the amount of letters to use for the suffix portion of split files.
- .br
- Total of
- .Ar name
- size and
- .Ar suffix_length
- cannot exceed
- .Dv NAME_MAX .
- .It Fl b Ar size
- Split into files of
- .Ar size
- bytes,
- .Ar size
- can be multiplied by one of KMGTP (Kilo, Mega, Giga, Tera, ...)
- using power of 1024 by default, which can be either explicit via adding iB
- (like MiB), or turned into powers of 1000 by adding B (like MB).
- .It Fl l Ar lines
- (Default: 1000) Split into files of
- .Ar lines
- lines.
- .El
- .Sh OPERANDS
- .Bl -tag -width name
- .It Ar file
- Path to the file to be split, defaults to
- .Pa -
- if unspecified.
- .It Ar name
- Prefix to be used for each split file, defaults to
- .Ql x .
- .br
- Total of
- .Ar name
- size and
- .Ar suffix_length
- cannot exceed
- .Dv NAME_MAX .
- .El
- .Sh EXIT STATUS
- .Ex -std
- .Sh SEE ALSO
- .Xr csplit 1 ,
- .Xr truncate 1
- .Sh STANDARDS
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me