CSPLIT(1)

โœจ CSPLIT(1) โœจ

okay so bestie, this is csplit from the GNU coreutils manual โ€” page one of section one, user commands, the whole vibe. it's the little sister of split and she is unhinged in the best way ๐ŸŽ€ she doesn't cut by size, she cuts by context. like, by meaning. main character energy fr fr ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

csplit โ€” split a file into sections determined by context lines. that's it, that's the girl. she takes one file and goes snip snip snip wherever the content tells her to ๐Ÿฆ‹


โญ SYNOPSIS โญ

csplit [OPTION]... FILE PATTERN...

๐Ÿ’– DESCRIPTION ๐Ÿ’–

So here's the tea ๐Ÿ“: csplit outputs pieces of FILE, separated by PATTERN(s), into files named 'xx00', 'xx01', ... โ€” and then, because she's an overachiever, she prints the byte counts of each piece to standard output. not me being obsessed with a byte count ๐Ÿ˜ญ

If FILE is -, she reads standard input. iconic behaviour, honestly.

โš ๏ธ Real talk: mandatory arguments to long options are mandatory for short options too. no shortcuts, babe. the rules are the rules ๐Ÿ’…

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -b, --suffix-format=FORMAT โ€” use sprintf FORMAT instead of %02d. you wanna name your babies something else? go off โœจ
  • -f, --prefix=PREFIX โ€” use PREFIX instead of 'xx'. so instead of xx00 you get whatever cute little prefix you dream up ๐Ÿฆ‹
  • -k, --keep-files โ€” do not remove output files on errors. she's usually like "oops, cleanup time" but with this she holds onto everything ๐Ÿซถ
  • --suppress-matched โ€” suppress the lines matching PATTERN. the matching line just... doesn't make it in. gone. ghosted ๐Ÿ’€
  • -n, --digits=DIGITS โ€” use specified number of digits instead of 2. more digits, more drama ๐Ÿ‘‘
  • -s, --quiet, --silent โ€” do not print counts of output file sizes. sometimes you just don't wanna hear the numbers, and that's valid ๐Ÿ™ˆ
  • -z, --elide-empty-files โ€” suppress empty output files. no empty files on this account, we don't do that here ๐Ÿ’…
  • --help โ€” display this help and exit. your girl is helpful ๐ŸŒˆ
  • --version โ€” output version information and exit. she'll tell you who she is โญ

๐Ÿงš Each PATTERN may be ๐Ÿงš

  • INTEGER โ€” copy up to but not including specified line number
  • /REGEXP/[OFFSET] โ€” copy up to but not including a matching line
  • %REGEXP%[OFFSET] โ€” skip to, but not including a matching line
  • {INTEGER} โ€” repeat the previous pattern specified number of times
  • {*} โ€” repeat the previous pattern as many times as possible

and one more lil note, bestie:

A line OFFSET is an integer optionally preceded by '+' or '-' ๐ŸŒธ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Written by Stuart Kemp and David MacKenzie. legends, truly. we stan ๐Ÿซถ


๐ŸŒˆ REPORTING BUGS ๐ŸŒˆ

ngl if you found a bug, tell them!! they wanna know!! ๐Ÿ›โœจ


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. like, none. zero. don't come for her ๐Ÿ’€

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

iykyk, the info page is right there, go read it ๐Ÿ“–


GNU coreutils 9.12, September 2026 โ€” and that's the whole page, bestie!! you ate that. go split something with context. periodt ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from