参考: https://discussions.apple.com/thread/7417623

方法一: raw query

  1. 进入要搜索的目录
  2. cmd+f, 可以再不输入任何搜索词的情况下进入搜索界面
  3. kind选项(左边的选择框), 选择other
  4. 弹出框选择raw query
  5. 输入: kMDItemFSName == “(1).
  6. 此时可以xxx(1).jpg这类文件搜索出来

方法二: 双引号

# 使用这个双引号包含的字符串可以搜索所有包含  ).
")."

方法三: applescript

tell application "Finder"
delete (every item of (choose folder) whose name contains “(1)")
end tell

方法四: zsh

  • 这可能是最好的办法了, 永远可以相信shell
# mac特殊写法
mdfind -onlyin . 'kMDItemDisplayName == "de*"c'
# linux通用写法

参考

好难找

  1. https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html
  2. https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/Introduction.html#//apple_ref/doc/uid/TP40001843-BBCFBCAG
  3. https://blog.scottlowe.org/2012/07/25/advanced-spotlight-queries-in-the-mac-gui/