Why use -print0 with xargs -0 instead of a plain pipe?
find . -name '*.bak' -print0 | xargs -0 rm
- Names with spaces stay intact
- It deletes the files in parallel
- It skips hidden backup files
- It asks before each deletion
Null-separated names cannot be split on spaces or newlines, so
Play Linux CLI ▸
my file.bak reaches rm as one argument.