fold=/home/mati/folder\ with\ spaces for i in $fold*; do echo $1; done the problem is, it won't echo the filenames because it doesn't understand the folder name has spaces in it, any way to fix this? i also tried setting fold='"/home/mati/folder\ with\ spaces"'