If you use the globstar
shell option (Bash 4.0 or newer1), you can do something like this:
shopt -s globstar
mdls -name kMDItemFSName -name kMDItemDateAdded **/*
The output will look something like
kMDItemDateAdded = 2018-07-10 15:33:04 +0000
kMDItemFSName = "File1.txt"
kMDItemDateAdded = 2018-07-11 17:18:11 +0000
kMDItemFSName = "File2.txt"
with the disadvantage that path information is lost.
If you have many, many files, resulting in a command line that gets too long, you can loop over the files instead:
for f in **/*; do
printf '%s\t%s\n' "$f" "$(mdls -name kMDItemDateAdded "$f")"
done
with output that looks something like
File1.txt kMDItemDateAdded = 2018-07-10 15:33:04 +0000
File2.txt kMDItemDateAdded = 2018-07-11 17:18:11 +0000
or you could use find
:
1 Which, in macOS, you'd have to install first, for example using Homebrew.