I'd like to list all the files in HDD including size, last modified date and absolute path.
idea format :
[file size] [last modified date] [absolute path] [ filename]
I tried:
ls -lhR | awk -v PWD=$PWD '{printf("%4s %4s %2s %5s %s/%s\n", $5, $6, $7, $8, PWD, $9); }' >> /tmp/report.list
It worked perfectly until it hit some files/directories with space in-between.... So I tried:
find . -name "*" -exec du -sh {} \; -exec date -r {} \; -exec echo " " \; >> /tmp/report.list
But the output seems spread into 3 lines instead of 2, also the printed path is not the absolute path to the file.
What should I do?