linux 批量去除文件名空格

去除空格,例如del_space.sh

for loop in `ls -1 | tr ' ' '#'`
do
mv "`echo $loop | sed 's/#/ /g' `" "`echo $loop |sed 's/#//g' `" 2> /dev/null
done