for x in `find -type f`; do sed -n "1{s,.*,${x##*/} &,p}" $x; done > output.csv for x in `find -type f`; do sed -n "1{s/.*/${x##*/},&/p}" $x; done > output.csv for x in `find -type f`; do sed -n "1{s/.*/${x:2},&/p}" $x; done > output.csv
Refer:http://bbs.chinaunix.net/thread-4152680-1-1.html