Name
csplit
Synopsis
csplit [options] file
arguments
Separate file into context-based sections and place sections in files named xx00 through xxn (n < 100), breaking file at each pattern specified in arguments. See also split.
Options
- -
Read from standard input.
- -b suffix, --suffix-format= suffix
Append suffix to output filename. This option causes -n to be ignored. suffix must specify how to convert the binary integer to readable form by including one of the following: %d, %i, %u, %o, %x, or %X. The value of suffix determines the format for numbers as follows:
- %d
Signed decimal.
- %i
Same as %d.
- %u
Unsigned decimal.
- %o
Octal.
- %x
Hexadecimal.
- %X
Same as %x.
- -f prefix, --prefix= prefix
Name new files prefix00 through prefixn (default is xx00 through xxn).
- -k, --keep-files
Keep newly created files even when an error occurs (which would normally remove these files). This is useful when you need to specify an arbitrarily large repeat argument, { n }, and you don’t want an out-of-range error to cause removal of the new files.
- -n num, --digits= num
Use output filenames with numbers num digits long. The default is 2.
- -s, -q, --silent, --quiet
Suppress all character counts.
- -z, --elide-empty-files
Do not create empty output files. However, number as if those files had been created.
Arguments
Any one or a combination of the following expressions may be specified as arguments. Arguments containing blanks or other special characters should be surrounded by single quotes.
- / expr /[offset]
Create file ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access