6

How do you search for a file of a specific type in OS X Yosemite? I cannot seem to find any instructions on how to do this.

In the Finder search I enter: kind:zip

But it returns all compressed files. I only want zip files - so this AD post does not help me much. All the solutions either use bash, or I cannot find the options they refer to.

4
  • @patrix Typing "kind:zip" in the Search Field is just plain text not source code and should not be shown as kind:zip and why I originally edited it among the other edits. Why did you change it back? I set it bold to differentiate however it could just be plain as it's plainly evident by syntax it was something typed. Commented Mar 4, 2015 at 16:23
  • @user3439894 This is probably not the last discussions we are going to have about formatting on AD, feel free to join in on meta.apple.stackexchange.com/questions/2361/… :-) In a nutshell: I see a significant difference between putting emphasis on some words and marking text which the user can/should type in. It is (at least on AD) quite common to use code formatting for the latter. If you want to discuss this further, please use the Meta site or the chat room.
    – nohillside
    Commented Mar 4, 2015 at 16:38
  • I'm going to point this at the existing search question. With some of the great answers here, I'm also considering merging the answers. Ask on Ask Different Meta if anyone has strong opinions on the close/merge options.
    – bmike
    Commented Mar 5, 2015 at 19:35
  • @bmike - I reference that post in my post - it does not answer this specific question. It answers it too generally and most are BASH solutions, not a Finder solution. The answer checked here actually answers this specific question. Thank you for your consideration on not considering this a duplicate, but more of an extension. Commented Mar 5, 2015 at 20:05

4 Answers 4

5

Open a new finder window and type "zip" in the search. Select "Zip archive" in "kinds".

You can also just type out kind:.zip and press enter and you'll get the appropriate filter:

enter image description here

Note - omitting the . after the : results in many compressed files and not just those with .zip extension or literal conformance to that specification.

5
  • This is the answer I was looking for - Thank you. BTW, you may want to mention that it takes a few moments before the dropdown options are displayed. That threw me for a while because I was not seeing it, and exited the search bar before it displayed. Commented Mar 4, 2015 at 15:28
  • @And yes, it does take a second or a half of a second :)
    – nicael
    Commented Mar 4, 2015 at 15:28
  • @AndroidAddict I've added a way to accelerate the typing and also linked this more strongly to 7 How Can I Search A Specific Type of File in Mac?
    – bmike
    Commented Mar 5, 2015 at 19:52
  • 1
    I'm confused. The kind.zip returns JARs too from the image that you posted. Whereas selecting the zip archive in the dropdown limits results to just zip files. Commented Mar 5, 2015 at 20:10
  • @And It was an edit from bmike. Read the answer to the end.
    – nicael
    Commented Mar 5, 2015 at 20:11
3

Type +F on Finder and you will see the search bar. By default appears Kind is Any. Replace Kind with File Extension (you can find it under Others...), then you can type zip in the field and you will have the results immediately.

Additionally if you feel confortable with the Terminal, you can use the following command:

find . -name "*.zip"
1
  • 1
    I appreciate the BASH solution (which I already know) - I want to learn how to do this through Finder if possible. Commented Mar 4, 2015 at 15:26
3

You can directly search for zip files by entering:

kMDItemFSName:.zip

or even better:

kMDItemKind:"Zip"

into Spotlight Search in Finder.

To get more kMD* keywords make mdls /path/to/file in Terminal to list them.

Here is great pdf with a list of search attributes and other hints.

1
0

Building on @mateusz-szlosek's answer:

in your .bash_profile, add the following two helper functions:

# search below current dir. syntax: f queryterm
f()
{
     mdfind -onlyin . "$2" 
}
# search below current dir, with extension. Syntax: f2 extension queryterm (e.g. f2 py hello)
f2()
{
     mdfind -onlyin . "$2" kMDItemFSName:."$1"
}

You can then search for zip files like this:

f2 zip blabla

You must log in to answer this question.

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