O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required