Postsread more
NUL-Delimited Workflows: Handling Any Filename Safely
Pop quiz: what characters can appear in a filename on Linux?
If you answered “letters, numbers, dots, dashes, underscores,” you’re thinking of sensible filenames. The actual answer is: every character except / (path separator) and NUL (the zero byte).
That includes spaces. Tabs. Newlines. Quote marks. Backslashes. Asterisks. Emoji. Control characters. Bell characters that make your terminal beep. All perfectly legal in filenames.
And that’s a problem, because most UNIX tools assume newlines separate records. When a filename contains a newline, tools get confused: