0

I would like a list of all the date added metadata for my Downloads folder on macOS. I found the following code (for macOS terminal) from http://forums.ilounge.com/applescripts-itunes-mac/100189-mdls-command-tiger.html, but it only works for the home directory. Adding a different directory as a modifier doesn't work, and using cd doesn't work. When I do those things, it still returns the results of the home directory. How do I get it to work for my Downloads folder, or is there another approach I should take? I've dabbled in AppleScript also if that is superior.

ls | mdls -name kMDItemDateAdded *

There is a similar question at Recursive file list of all files, list containing path+name, type, size, creation data, modification date, but I am not knowledgable enough to see if I can adapt it to my purposes.

  • ls outputs just the name so if you aren't in that dir mdls wont find that file... you could pushd and ls there then popd or get ls to output the whole file path – Grady Player Jul 31 '18 at 21:58
  • I guess `find somepath | mdls -name kMDItemDateAdded *` would probably work – Grady Player Jul 31 '18 at 22:00

1 Answers1

0

The following lists all dates:

mdls -name kMDItemDateAdded ~/Downloads/*

Felipe Cabargas
  • 1,006
  • 7
  • 10
  • This simple solution worked perfectly, thanks! Is it possible to have it done recursively? What about having a "/" added to the end of a directory name? The respective 'ls' commands would be '-R' and '-p'. – Self-Taught Greenhorn Aug 01 '18 at 03:09