How to copy from standard input

I tried copy the output files from find command into a directory.
Example,
find / -name core 2>/dev/null | xargs cp????

I have known that we can use xargs to execute command lines from standard input but how to use it in this case.

Or I can do something besides xargs.

I don't understand

If you find multiple core files, copying them to the same directory is not going to work.

I've never used xargs, but you can try this:

find / -name core -exec cp {} /path/to/outdir \;

Of course, as stated by awk copying multiple files named "core" in a single destination directory you will end in overwriting all the files. You will get in the output dir only the LAST found core file!

Maybe you can substitute the "cp" command with a custom shell which appends an incrementing number to each core file before copying that in the out dir.