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

Comments

Popular posts from this blog

Using PlayStation 1 Densha de Go controller on emulators

Using PS1/PC Densha de Go! controller SLPH-00051/TCPP-20001/DGOC-44U on PS4/Switch Densha de Go!!

Play octoshape stream on windows with VLC player