-print0
The find action that ends each file name with a null byte instead of a newline, for use with xargs -0.
In more detail
The null byte is the one character a file name can never contain. Paired with xargs -0, the list survives every name, including ones with spaces, quotes or newlines.
Example
find tricky -type f -print0 | xargs -0 -n 1 echo item:Related terms
- xargs — The command that reads items from its standard input and runs another command with them as arguments, in batches.
- null byte — The character with value zero, which can never appear inside a Unix file name and so makes a safe separator between names.
- find command — The find command, which walks a directory tree and prints, or acts on, every entry that passes its tests.
Taught in
- find And xargs — Bash Scripting & Command Line Automation