Tell `ls` to print only the base filename
xargs -0 is intended to be used for input delimited by \0 (like
ls has no such option to delimit its output in this way.
ls -1 /path/glob | tr '\n' '\0' | xargs -0 -n 1 basename
would do the trick to convert newlines to nulls along the way. This then allows xargs to work with names that have spaces.
-n 1 to xargs
I use this:
ls | tr '\n' '\n'
It gives a list like:
file1.mp3 file2.mp3 file3.mp3 ...
ls -1 <path> | sed 's#.*/##'