I have about 50,000 files in a folder tree which show up as the correct "Kind" in Finder ("Sound Designer II audio") but which have no extension.

I want to find all these and rename them to *.sd2 in Terminal.

Can the find command be used to find by "kind" without any extension?

1 Answer 1


To search all files with a distinctive kind use the command:

mdfind 'kMDItemKind="Sound Designer II audio"'

If this is not sufficient you can also use the type code (yyyy below is a place holder only)

mdfind 'kMDItemFSTypeCode="yyyy"'

You should be able get an (unknown) type code of a Sound Designer II audio file by executing mdls "/path/to/Sound Designer II audio file" | grep kMDItemFSTypeCode

  • Fantastic! How would I run a command on each result, like the -exec argurment of find?
    – d0g
    Sep 21, 2016 at 16:08
  • @Ze'ev Probably some ... | xargs -0 -I mv '{}' ... thingy
    – klanomath
    Sep 21, 2016 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .