The xargs
command takes white space characters (tabs, spaces, new lines) as delimiters.
You can narrow it down only for the new line characters ('
') with -d
option like this:
ls *.mp3 | xargs -d '
' mplayer
It works only with GNU xargs.
For MacOS:
ls *.mp3 | tr \n \0 | xargs -0 mplayer
The more simplistic and practically useful approach (when don't need to process the filenames further):
mplayer *.mp3
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…