Skip to main content
1 of 2
meuh
  • 54.7k
  • 2
  • 70
  • 138

In -printf '%P\0' the %P is just removing the initial ./ from the front of the filename. You can do the equivalent with sed 's|^\./||'. The \0 part produces a null character instead of newline between each filename. You can convert newline to null with tr '\n' '\0'. So you can try

find . -mindepth 1 -print | sed 's|^\./||' | tr '\n' '\0'

If any names contain a newline, this will corrupt them, translating that newline to null.

meuh
  • 54.7k
  • 2
  • 70
  • 138