Ls -al on filename with spaces

I am trying to extract the size and filename from a group of files. Normally I would just do an ls -alR combined with an awk ‘{print %5" "$9}’. However this doesn’t work with filename with spaces.

I found some things from a google search but they don’t work either. Here is other things I have tried.

ind /home/glrider/A53Music/Comedy -maxdepth 2 -type f -name “*.mp3” | while read name
do
echo $name
name=‘"’$name’"’
echo $name
ls -al $name
done

or

clear
cd ‘/run/user/1000/gvfs/mtp:host=SAMSUNG_SAMSUNG_Android_R5CT62NC5EN/Internal storage/Music/Comedy’
find . -name “Jerky Boys - Denta*.mp3” > /tmp/a53.lst1

cat /tmp/a53.lst1 |
while read line
do
newline=“'”$line"'"
echo “newline=”$newline
filesize=ls -al $newline | awk '{print $5}'
echo $line
done

exit

All situations end with ls dealing with the filename as separate files, even with single quotes or double quotes wrapped around it.

I should have added I am trying to do this in a shl script. It seems to work on the command line.

lrider@glrider-linux:/run/user/1000/gvfs/mtp:host=SAMSUNG_SAMSUNG_Android_R5CT62NC5EN/Internal storage/Music/Comedy$ ls -al “./Jerky Boys - Dental Malpractice.mp3”
-rw------- 1 glrider glrider 3069952 Jan 1 13:16 ‘./Jerky Boys - Dental Malpractice.mp3’
glrider@glrider-linux:/run/user/1000/gvfs/mtp:host=SAMSUNG_SAMSUNG_Android_R5CT62NC5EN/Internal storage/Music/Comedy$

I think you want to use the find -print0 option to separate the file names with nulls instead of spaces. You can then use xargs -0 to grab out the individual file names, which will need to be in quote if passed through a variable.

# touch "has spaces in it"
# find -maxdepth 1 -iname 'h*' -print0 | xargs -0 printf ">>%s<<\n"
>>./has spaces in it<<
>>./heap.py<<
>>./hosts.txt<<