Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

split

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
split [OPCIÓN]... [ENTRADA [PREFIJO]]

Crear archivos de salida conteniendo secciones consecutivas o intercaladas de entrada

Options

--bytes=<SIZE>, -b <SIZE>

poner TAMAÑO bytes por archivo de salida

--line-bytes=<SIZE>, -C <SIZE>

poner como máximo TAMAÑO bytes de líneas por archivo de salida

--lines=<NUMBER>, -l <NUMBER>

poner NÚMERO líneas/registros por archivo de salida

--number=<CHUNKS>, -n <CHUNKS>

generar FRAGMENTOS archivos de salida; ver explicación abajo

--additional-suffix=<SUFFIX>

SUFIJO adicional para anexar a nombres de archivos de salida

--filter=<COMMAND>

escribir a COMANDO shell; el nombre de archivo es $FILE (Actualmente no implementado para Windows)

--elide-empty-files, -e

no generar archivos de salida vacíos con ‘-n’

-d

usar sufijos numéricos empezando en 0, no alfabéticos

--numeric-suffixes=<FROM>

igual que -d, pero permite establecer el valor de inicio

-x

usar sufijos hexadecimales empezando en 0, no alfabéticos

--hex-suffixes=<FROM>

igual que -x, pero permite establecer el valor de inicio

--suffix-length=<N>, -a <N>

generar sufijos de longitud N (predeterminado 2)

--verbose

imprimir un diagnóstico justo antes de que se abra cada archivo de salida

--separator=<SEP>, -t <SEP>

usar SEP en lugar de nueva línea como separador de registro; ‘\0’ (cero) especifica el carácter NUL

--io-blksize

Generar piezas de tamaño fijo de ENTRADA a PREFIJOaa, PREFIJOab, …; el tamaño predeterminado es 1000, y el PREFIJO predeterminado es ‘x’. Sin ENTRADA, o cuando ENTRADA es -, leer entrada estándar.

Examples

Split a file, each split having 10 lines (except the last split):

split {{[-l|--lines]}} 10 {{path/to/file}}

Split a file into 5 files. File is split such that each split has same size (except the last split):

split {{[-n|--number]}} 5 {{path/to/file}}

Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):

split {{[-b|--bytes]}} 512 {{path/to/file}}

Split a file with at most 512 bytes in each split without breaking lines:

split {{[-C|--line-bytes]}} 512 {{path/to/file}}

Split into multiple files from stdin:

gzip {{[-cd|--stdout --decompress]}} {{path/to/compressed_file.gz}} | split {{[-l|--lines]}} {{1000}} - {{path/to/output}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.