-z, --elide-empty-files
Suppress generation of empty output files.
An option of csplitx.
Usage
csplitx -z FILE PATTERN...
csplitx --elide-empty-files FILE PATTERN...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-z | --elide-empty-files | none | suppress generation of empty output files |
Examples
Do the same without the empty file before the first chapter
csplitx -z -f chapter- -b '%02d.md' book.md '/^# /' '{*}'Split a multi-document Kubernetes YAML into one manifest per file, dropping the '---' lines
csplitx -z --suppress-matched -f manifest- -b '%02d.yaml' all.yaml '/^---$/' '{*}'Cut a log into one file per day, where each day starts with a '=== 2026-' banner
csplitx -z -f day- app.log '/^=== 2026-/' '{*}'Split standard input from another command
git log --format='commit %H%n%B' | csplitx -s -z -f commit- - '/^commit /' '{*}'Help in the terminal
gnux help csplitx --elide-empty-files