macOS-mdls列出文件元数据命令

使用 mdls 获取文件的UTI类型

  • 获取文件的UTI类型,媒体类型,文件类型
    $ mdls /Library/Desktop\ Pictures/Aqua\ Blue.jpg

    kMDItemContentType = “public.plain-text”

  • 获取APP的Bundle ID
    $ mdls -name kMDItemCFBundleIdentifier -r /Applications/Notes.app

    com.apple.Notes

使用 file 命令查看文件的 mime 类型

1
file --mime-type /some/file

macOS-mdls列出文件元数据命令
https://dnacore.github.io/post/f6f86c2b-31a6-4d39-a6c2-cef4f999b95c.html
作者
DNACore
发布于
2023年2月10日
更新于
2024年12月9日
许可协议