|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors regular
Join Date: Feb 2008
|
Is there an "Advanced Search" in Finder?
Okay, I have wanted this so many times that I am going to ask you all.
Is there an "Advanced Search" capability in Finder? I have found the preferences, and the +/- buttons that allow you to add multiple search fields, but this is not enough. I want "and" and "or" conditionals connecting the multiple search fields/criteria. I also DESPERATELY want the ability to search in all subdirectories of directory foo, or just look at files in the directory foo itself. I also really want "is not" for the search fields, instead of just "is". For instance, right now I am looking for " filename is '.py' ", but I really want to add the conditions " do not search subdirectories " and " filename is not 'music' ", because I am seeing all 2000 .py scripts from subdirectories and 500 py scripts with 'music' in the filename which I know I don't want. I would love to be able to use Unix path syntax, like foo/*.py, and ~/foo/*.py. Regexen would be AWESOME: e.g ^[a-bA-B0-9\./]*/[a-b]*.py$ this regex would find any .py files and NO .pyc files, but only .py files without digits or uppercase in the filename. Do people know of a way to tackle any of these? |
|
|
|
| bollweevil |
| View Public Profile |
| Find More Posts by bollweevil |
|
|
#2 |
|
macrumors 68030
Join Date: Feb 2008
Location: Santa Cruz Mountains, California
|
Terminal commands can probably do everything you want. For example, if you want all files in the current directory ending in ".py" but not including "music" in their name:
ls -1 *.py | grep -v music If you want to recursively search a directory tree, the find command can be used: find . -name "*.py" -exec ls -1 \{\} \; | grep -v music The ls and find commands can both use regex patterns. You can run "man ls" and "man find" and check out how those work.
__________________
laptop: aluminum MB 2.4GHz/4GB/250GB/9400M, 10.5.8/XP Pro desktop: Core i7 920 2.66GHz/4GB/640GB/XFX GeForce 9600 GSO, 10.6.2 previous: Mac Plus, IIci, PB 100, Quadra 840av, PowerMac G4, iBook G3/G4 |
|
|
|
|
|
#3 |
|
Thread Starter
macrumors regular
Join Date: Feb 2008
|
Thank you Eric, but what I really desperately want is a nice GUI to do this. I got the ideas from using ls and find, in fact. The problem with ls and find is that I get a list, but a plain text list is not so easy to sort by 'Last opened' and then resort by 'size', and then right click on one of the files.
I hesitated to ask this question because it will only save me 30 seconds relative to using terminal each time, but those 30 seconds really add up over dozens and hundreds of searches that I do. Do I want Google Desktop or something? |
|
|
|
| bollweevil |
| View Public Profile |
| Find More Posts by bollweevil |
|
|
#4 |
|
macrumors newbie
Join Date: Dec 2006
|
Press "Option" and then click on the + button (should be shown as ...)
|
|
|
|
|
|
#5 |
|
Thread Starter
macrumors regular
Join Date: Feb 2008
|
Thanks Haginile, that is excellent. That answers one of my questions, and makes the entire thread worthwhile, I now know how to in effect do "is not" and "or" as well as the standard "is" and "and".
Other questions remain. Especially: How do I search non-recursively, for only the immediate contents of this directory. |
|
|
|
| bollweevil |
| View Public Profile |
| Find More Posts by bollweevil |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|