The command
find ~user would find all names, including those containing newlines. Add -type f if you want to only find regular files.
If you don't want to restrict the matching of names, don't use a test on the names.
YouTo restrict the names matched using substrings, you could also use a globbing pattern with the -name test. Both * and ? matches newlines in a globbing pattern., both in the shell in general and in the -name test of find:
Example using standard find:
$ find . -name 'file?name' ./file name $ find . -name 'file*name' ./file name $ find . -name 'd*name' ./dir name $ echo ./d*name ./dir name Answer to misunderstood question ("How may I find names containing newlines"):
Using standard find:
find ~user -name '* *' Using "C-strings" in shells that support these (still using standard find)
find ~user -name $'*\n*' None of the built-in regular expression types normally available in GNU find is able to match a newline with \n, so you're left using a literal newline, just like in the globbing patterns above. This means it's probably easier to use a standard -name test than a non-portable -regex test.