Mac OSX Commands:mdls

 命令: mdls
这个命令显示指定文件的metadata的属性
可以制定具体的属性名称,则只显示该属性的值
例如: mdls /var

下面是我机器上的输出:
~/Desktop admin$ mdls MACvsPCCombined.pdf
MACvsPCCombined.pdf -------------
kMDItemAttributeChangeDate = 1969-12-31 17:00:00 -0700
kMDItemFSContentChangeDate = 2007-09-17 15:33:49 -0600
kMDItemFSCreationDate      = 2007-09-17 15:33:44 -0600
kMDItemFSCreatorCode       = 1886549623
kMDItemFSFinderFlags       = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "MACvsPCCombined.pdf"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 501
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 1940371
kMDItemFSTypeCode          = 1346651680
kMDItemID                  = 524678

一个alias的属性:
~/Desktop admin$ mdls ./ARD_3.1_AdminGuide.pdf/ alias
./ARD_3.1_AdminGuide.pdf alias -------------
kMDItemAttributeChangeDate = 1969-12-31 17:00:00 -0700
kMDItemFSContentChangeDate = 2008-03-01 19:36:45 -0700
kMDItemFSCreationDate      = 2007-08-02 13:23:26 -0600
kMDItemFSCreatorCode       = 1886549623
kMDItemFSFinderFlags       = 33792
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "ARD_3.1_AdminGuide.pdf alias"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 501
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 44150
kMDItemFSTypeCode          = 1346651680
kMDItemID                  = 400618

一个folder的属性:
~/Desktop admin$ mdls ./Doc                          
./Doc -------------
kMDItemAttributeChangeDate = 1969-12-31 17:00:00 -0700
kMDItemFSContentChangeDate = 2008-09-09 15:13:49 -0600
kMDItemFSCreationDate      = 2007-06-04 15:12:04 -0600
kMDItemFSCreatorCode       = 0
kMDItemFSFinderFlags       = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "Doc"
kMDItemFSNodeCount         = 21
kMDItemFSOwnerGroupID      = 501
kMDItemFSOwnerUserID       = 501
kMDItemFSTypeCode          = 0
kMDItemID                  = 1282267

*****************************************
mdls: lists the metadata attributes for the specified file
SYNOPSIS
     mdls [-name attributeName] file ...

DESCRIPTION
     The mdls command prints the values of all the metadata attributes associ-
     ated with the files provided as an argument.

     The following options are available:

     -name  Print only the matching metadata attribute value.
原文链接: http://blog.csdn.net/afatgoat/article/details/3192047

你可能感兴趣的:(Mac OSX Commands:mdls)