In "man xargs", under "--null, -0", it explains "The GNU find -print0 option produces input suitable for this mode." However, "-print0" is not an "option" for GNU find. It is an "action" which, if it is evaluated, *always* prints all filenames and always returns true. Thus, "find . -print0 -name *.wma | xargs -0 --replace=stuff rm stuff" will, in fact, delete EVERY file in the current directory and all subdirectories, while "find . -name *.wma -print0 | xargs -0 --replace=stuff rm stuff" will only delete all .wma files. Due to this man file error, I deleted a third of my music collection. Reproducible: Always Steps to Reproduce: Expected Results: The "-print0" action, relying on "find"'s lazy evaluation of arguments, has too complicated a usage to be explained in a one-line description in "man xargs". I would suggest changing the line to "The GNU find -print0 action can produce output for this mode; see "man xargs" for syntax information before using it."
Ouch, I'm sorry to hear about your music collection! Nonetheless, this seems more like user error than anything else. When doing something like a mass rm, it's advisable to use "echo" in place of "rm" to see what it's going to do. Your suggestion for changing the documentation isn't a bad one, but I'd rather not patch the documentation in Gentoo unless it's going to be patched upstream. If you think it should be patched, please take it to the findutils maintainers via bug-findutils@gnu.org and we'll pick up the fix when it is published
*** Bug 37057 has been marked as a duplicate of this bug. ***