在 macOS 终端中,"ls | mdls" 命令仅适用于主目录

In the macOS terminal, "ls | mdls" commands are only working for the home directory

我想要 macOS 上我的“下载”文件夹的所有 添加日期 元数据的列表。我从 http://forums.ilounge.com/applescripts-itunes-mac/100189-mdls-command-tiger.html 中找到了以下代码(适用于 macOS 终端),但它仅适用于主目录。添加不同的目录作为修饰符不起作用,使用 cd 也不起作用。当我做那些事情时,它仍然是 returns 主目录的结果。我如何让它为我的下载文件夹工作,或者我应该采取另一种方法吗?如果它更好的话,我也涉足了 AppleScript。

ls | mdls -name kMDItemDateAdded *

Recursive file list of all files, list containing path+name, type, size, creation data, modification date 也有类似的问题,但我的知识不够了解是否可以根据我的目的进行调整。

以下列出所有日期:

mdls -name kMDItemDateAdded ~/Downloads/*