Skip to Content
gnux

-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

ShortLongValueDefaultMeaning
-z--elide-empty-filesnonesuppress 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

On this page