More find magic — this little beast takes a while to run on large directories but is worth it’s weight in gold. Now I just need a way to convert Epoch time to YYYYMMDD format inline. (New project)
find ./foo/ -type f -printf '%f|%h|%s|%AY%Am%Ad|%TY%Tm%Td|' -exec stat --printf "%W|" '{}' \; -exec file -bp '{}' \; > bar.log
%f == file name without leading directories
%h == leading directories without file name
%s == size in bytes
%A = Last access time (Y,m,D = YYYYMMDD format)
%T == Modification time (Y,m,D = YYYYMMDD format)
(using printf keeps everything on the same line)
stat %W == file birth date in Epoch time
file -bp == checks file type, b==brief, p==preserve date