Files can be listed recursive like thisls public_html -R -go * | sed 's/[ ]/,/g' > files.csvProblem is that columns won't match. If I open the file in Excel, some dates are in column D and some in E. Is there any way to get recursive list and keep columns in place?
List folder files recursive to file, match columns
shell script
Don't parse ls: its output is meant for humans to parse, not machines. You want the stat command, and your shell's recursive globbing syntax. Try this:stat -c '%A,%h,%s,%y,%n' public_html/** > file.csvThe mtime format will be different. Read the stat man page.Or findfind public_html -printf %M,%n,%s,%t,%p\n > file.csv