logo

utils-std

Collection of commonly available Unix tools
commit: 36741fde59e60937b7016e46f1223f4c8d917aca
parent 9322dda8ead9bf310533262dccb8840b8c73fcdf
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 16 Aug 2024 11:24:08 +0200

cmd/split: add manpage

Diffstat:

Acmd/split.182+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+), 0 deletions(-)

diff --git a/cmd/split.1 b/cmd/split.1 @@ -0,0 +1,82 @@ +.\" 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 +.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