Keep up with ls, if at all possible. Use find from findutils package.
find /target/path -type f -print0 | xargs -0 your_command_here
-print0will force find to output names separated by NUL characters (ASCII zero). The argument -0for xargs suggests that it expects arguments separated by NUL characters, so everything will work fine.
Replace /target/pathwith the path where your files are.
-type fwill only detect files. Use -type dfor directories or omit completely to get both.
your_command_here , . (. , echo _, - , xargs .)
: ( xargs),
find /target/path -type f -exec your_command_here \{\} \;
\{\} \; - escape {} ;, . find your_command_here {} ; , your_command_here find, , .
, find . xargs , , . xargs, .