cmdxray / commands / split

What does split do?

split a file into fixed-size or fixed-count pieces.

▸ Explain your own split command →

split examples, explained

$ split -l 1000 big.txt part_

  • splitsplit a file into fixed-size or fixed-count pieces
  • -lput this many lines in each output file
  • 1000value for -l
  • big.txtan argument passed to the command
  • part_an argument passed to the command

$ split -b 10M file.iso chunk_

  • splitsplit a file into fixed-size or fixed-count pieces
  • -bput this many bytes in each output file (accepts K/M/G)
  • 10Mvalue for -b
  • file.isoan argument passed to the command
  • chunk_an argument passed to the command

$ split -n 4 -d data seg_

  • splitsplit a file into fixed-size or fixed-count pieces
  • -nsplit into this many equal chunks
  • 4value for -n
  • -duse numeric suffixes (00, 01, …) instead of letters
  • dataan argument passed to the command
  • seg_an argument passed to the command

split flags & options

-lput this many lines in each output file
-bput this many bytes in each output file (accepts K/M/G)
-nsplit into this many equal chunks
-duse numeric suffixes (00, 01, …) instead of letters
-alength of the generated suffixes
-Cat most this many bytes per file, but keep lines whole
-xuse hexadecimal suffixes
--linesput this many lines in each output file
--bytesput this many bytes in each output file
--numbersplit into this many equal chunks
--suffix-lengthlength of the generated suffixes
--additional-suffixappend this suffix to output file names

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.