for f in *
do
echo "$f"
done
But the loop will cancel as soon as it tries the first file with a whitespace character. This is because the shell uses the whitespace character as a field separator. You can change the field separator however.
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *
do
echo "$f"
done
IFS=$SAVEIFS
Found it here: http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html 05/29/2012