Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

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. The byte count for each section is written to standard output. See also split.

Options

-

Read from standard input.

-b format, --suffix-format=format

Use sprintf format instead of %02d for the suffix.

-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 display of 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 from the current line up to the line containing the regular expression expr. offset should be of the form +n or -n, where n is the number of lines below or above expr.

%expr%[offset]

Same as /expr/, except no file is created for lines before a line containing expr.

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.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page