mdls

【技巧】mac命令行转化图片格式

回眸只為那壹抹淺笑 提交于 2020-04-06 22:41:13
###命令行行天下 sips可以转换一个或多个图片文件的文件格式 sips -s format [格式名称] [文件名] --out [输出文件的名称] sips -s format png goswift.jpg --out goswift.png 要想批量转换图片文件,我们需要使用下面命令格式 for i in [文件名]; do sips -s format [格式名称] $i --out [终点]/$i.[格式名称];done for i in *.jpeg; do sips -s format png $i --out Doc/$i.png;done ###按比例缩放 sips -Z 600 goswift.png sips -z 300 600 goswift.png ###查看图片信息 file go-swift.png //文件信息 mdls go-swift.png //可以获取到图片详细信息 来源: oschina 链接: https://my.oschina.net/u/819364/blog/726414

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

老子叫甜甜 提交于 2019-12-08 09:23:28
问题 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