A good way to list all file names (probably with whitespace) in bash
Typical find . bash command interprets a file with whitespace in name into multiple files. To avoid this problem, use the following construct, find . - iname "foo*" | while read f do echo ${f} done Reference To eliminate leading ./ in the listed file names, change the code above to the following. find . - iname "foo*" | while read f do echo ${f#./} done Reference