9 ms·
Countless person-years of engineering effort, and Spotlight is still mostly useless. All I want is to hit Command-F to quickly search the filenames in the curr
by zestyping 4y ago
Countless person-years of engineering effort, and Spotlight is still mostly useless.
All I want is to hit Command-F to quickly search the filenames in the current folder (not start a sluggish scan of my entire hard disk). There used to be workarounds for this, but then they removed "Find by Name..." from Finder just to make our lives harder. Does anyone know a workable alternative?
- coldpie 4y agoLike in a Finder window? I just start typing a filename and it jumps to the letters I typed. In the column view, you can use tab and shift-tab to switch between columns, allowing quick navigation into a directory tree. I may be misunderstanding you?
- jjav 4y ago> Does anyone know a workable alternative? Terminal and /usr/bin/find
- chongli 4y agoFinder -> Preferences -> Advanced. When performing a search: Search the current folder
- zestyping 4y agoThat searches the _contents_ of the files in the current folder. I just want to search the names (the way Cmd-F works in, you know, every other application: it searches what you see in the window).
- orpheansodality 4y agowow - how is this not the default? It's always the behavior that I expect to happen, and I'm pretty much always surprised and disappointed when it does a global search instead.
- zinckiwi 4y agoEspecially when global search is only ever a Cmd-Space away.
- anigbrowl 4y agoWindows also defaults to full text file searches instead of filenames, which is super annoying when you have thousands upon thousands of documents. It's often faster to open a terminal window, type 'dir search string and open the file from the terminal.
- smw 4y agoTry everything search [0], I don't think I could use windows without it. Just search filenames, instant, whole disk. [0] https://www.voidtools.com/support/everything/ https://www.voidtools.com/support/everything/
- zeppelin101 4y agoSeconded. This is a killer app. I can't imagine using Windows without it.
- hwbehrens 4y ago> how is this not the default? This is just speculation, but based on a conversation with my partner, there are two types of computer users. The first group makes use of hierarchical storage, consistent naming conventions, and other organizational tricks to give them a rough idea of where any file might be. The second group has never heard the term "file systems" and just stores everything with an arbitrary name in whatever location the originating application uses by default. The first group would prefer to search the given directory, because the supplied context (of which folder to start the search in) drastically improves/speeds search results. The second group prefers to search the entire disk, because supplying that additional context is impossible - any file might appear anywhere. The set intersection between the first group and "people who change their default settings" is much higher than it is with the second group. Consequently, the whole disk search is enabled by default. Additionally, given the addition of an "All My Files" view in Finder (a feature which the first group would probably find baffling), Apple may also believe that the latter group outnumbers the former.
- kennend3 4y agoThanks!! Having it search my mac by default was a mild annoyance (you can click search current folder once the search starts). But this is helpful
- seanp2k2 4y agoalso `mdfind whatever` if you prefer the CLI
- fiddlerwoaroof 4y agoIf you want by name `mdfind -name whatever`.
- nuker 4y agoalso fd, brew install fd
- satysin 4y agoIf you have a setup script add the following to set this automatically: defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
- shoelessone 4y agoI'm interested in what you mean by "setup script" - I assume you have a script of some sort you run when / if you re-install the OS? I'd love to hear more about this!
- satysin 4y agoI have a simple shell script that does a bunch of setup for me to automate things. It grabs my dot files and restores them, installs Homebrew and a bunch of programs, restores their plists (I have backup script that backs up all their plists) and writes a bunch of macOS settings via the `defaults write` command. I can install/wipe macOS, follow the initial setting screens then when on the desktop I just connect to my NAS, copy over one script and run it in the Terminal to get my machine setup how I like it. It isn't perfect but it does about 97% of the work for me with the added bonus that it is consistent/reproducible for the most part so avoids me forgetting to change a setting some place. I don't go crazy with it as I don't wipe my machine often enough to justify going all out with a fully automated system. Honestly it is less to save time and more to maintain consistency and have a 'documented as code' record of my environment setup (not quite infrastructure as code levels :)
- sjg 4y agoLook up dotfiles on GitHub - for example https://github.com/mathiasbynens/dotfiles/blob/main/.macos https://github.com/mathiasbynens/dotfiles/blob/main/.macos
- warvariuc 4y agoOh, my! # Trackpad: enable tap to click for this user and for the login screen # Trackpad: map bottom right corner to right-click # Disable “natural” (Lion-style) scrolling
- insane_dreamer 4y agoAgreed. Its an embarrasment. Use Alfred; I've been using it for years (10 maybe?) -- solves this problem and is extremely useful in general
- rcarr 4y ago+1 for Alfred. Amazing software.
- blackSnake 4y ago++2 for Alfred. AND it has plugins so you can search your Chrome or Brave tabs with Alfred as well. I just hit CMD + Shift + T and it'll search all my open tabs without the browser being in focus. I had to pay but it wasn't much. Use it everyday! https://github.com/epilande/alfred-browser-tabs https://github.com/epilande/alfred-browser-tabs
- insane_dreamer 4y agooooh, I hadn't seen that plugin before; nice
- ajgrover 4y agoI used Alfred for 10+ years as well, but am a recent Raycast convert. Much larger and easier to use extension ecosystem, and looks nicer too IMO.
- 4y ago
- LeoPanthera 4y agoWell yes but in Ventura "Preferences" is now "Settings". ¯\_(ツ)_/¯
- ideamotor 4y agoHilarious this is not default. Thanks.
- behnamoh 4y agoWhy isn't this the default setting? I mean, who searches their entire machine when they're inside a folder?
- Tagbert 4y ago@hwbehrens lays out the likely reason in an earlier post https://news.ycombinator.com/item?id=33321978 https://news.ycombinator.com/item?id=33321978 Short answer Large number of users don’t use folders to organize their files. They just depend on searching everywhere to find files that may have dropped in any random location. Those people are less likely to find the setting that makes current folder the default search target.
- ggandhi 4y agoCheck this: https://github.com/ospfranco/sol https://github.com/ospfranco/sol
- dorian-graph 4y agoHaving grown tired of the design of Alfread and not wanting to commit to VC-backed Raycast, this is a nice discovery! Edit: A plugin system is on the TODO and that'd be the clincher.
- artificialLimbs 4y agoBasic file search is broken. Still nothing like VoidTools Everything-like SMB share indexing either. Maybe Spacedrive will have these things when released? *crosses fingers
- lilyball 4y agoNo they didn't. Find by Name… still exists. It's ⌃⇧⌘F (ctrl-shift-cmd-F). You might have missed it because it's a dynamic menu item (Find turns into Find by Name… once you press ⌃⇧). Tip: Use the Help menu to search menu items. I just pressed ⌘? and typed "Find" and Find by Name… popped up.
- zestyping 4y agoCtrl-Shift-Cmd-F? Are you forking kidding me? I know sometimes you can press Option to show secret menu items (which I bet <10% of Mac users know) but Ctrl and Shift too? So now you have to press 7 different combinations of modifier keys just to discover what menu commands are available. Just wow. Thank you for showing me that menu command! That'll be a lifesaver going forward. Usability achieved despite Apple design, not because of it.
- sitzkrieg 4y agovery intuitive /s
- cromka 4y ago> I just pressed ⌘? and typed "Find" and Find by Name Damn, been using macOS for 9 years now and just found out about this :o Thanks!
- isametry 4y agoThe "Help" menu item is a major lifesaver and especially in complex apps (that is, those which actually take advantage of macOS' native menus, which sadly isn't a given nowadays). For example Photoshop (and its colleagues) is darn near impossible for me to use on Windows — and at least 50% of the reason is absence of the "Help" menu search feature.
- vvilliamperez 4y agoI'm still on Monty, does this work? https://imgur.com/a/ExV2wrP https://imgur.com/a/ExV2wrP
- rcarmo 4y agoWhat I typically do is remove _anything_ (web suggestions, etc.) that is not related to files. Usually fixes Spotlight across the board.
- alin23 4y agoI still wish for something like Everything on Windows (https://www.voidtools.com/ https://www.voidtools.com/) I wrote my own solution using fd + sqlite + fzf but it's nowhere as fast as Everything, and it also requires me to focus the Terminal to use it.
- MuffinFlavored 4y agoEverything is only fast because of an index, right? How it catches all file writes to update that index near instantaneously, I have no idea.
- alin23 4y agoEverything uses NTFS journaling as far as I know. I actually solved that by using the native macOS fsevents API which can watch the whole filesystem for changes, and I can instantly update the SQLite db I use for the index through that. The problem is actually enumerating and searching the whole database, that's the slow part. Right now I have over 5 million rows in it and passing the SELECT results to fzf is the slowest part, taking a few seconds at least on an M1 Max. I'm not sure how Everything presented the results so fast, with metadata and everything.
- cube2222 4y agoThe fsevents part is interesting, didn't know that! To your point regarding the slowness - in that case it's not really acting as an index though, is it, if you're scanning the whole list and passing it to fzf? A proper fuzzy text search index (I think elastic and similar engines have these built-in) should yield orders of magnitude better performance.
- alin23 4y agoYes, you're right. I did try Meilisearch for this but I wanted close-to-instant Smith-Waterman fuzzy searching which is why I settled on FZF. In the end I might have to reimplement that in Swift with an always cached index and native Spotlight like search bar to really make this as easy to use as I want. It's not practical to reach for the browser or Terminal to do this search.
- tambourine_man 4y agoNo workaround needed, just poorly placed settings and toggles: • Finder -> Preferences -> Advanced -> “When performing a search: Use the Previous Search Scope” • On any Finder window, CMD-F -> Search: This Mac / [ FolderName ] • On the loupe: “Filename” instead of “Everything” Enjoy
- kayodelycaon 4y agoYou can do name:searchitem and it'll find by name.
- max_hammer 4y agoI started using Alfred app recently on my work laptop. It's far superior than `Spotlight` https://www.alfredapp.com/ https://www.alfredapp.com/
- lelandfe 4y agoIt should be embarrassing how much faster Alfred's search is. Using Alfred to just search feels like using a Ferrari to pick up groceries, but it really is just better – and has been for as long as I can remember.
- Hamuko 4y agoDoesn't Alfred just use the Spotlight in the backend for searches?
- lelandfe 4y agoIt keeps your applications in a small (i.e fast) cache, so it's more or less instant when using it as an app finder. I think it, yes, uses the Spotlight index for finding files, although I wouldn't be surprised if Alfred does some clever stuff on top of it too.
- samlader 4y agoI recommend checking out Raycast as an alternative. https://www.raycast.com/ https://www.raycast.com/
- jbverschoor 4y agoRaycast is great. imo better than Alfred. Love the menu-search functionality. But I still use both, because Raycast doesn't support "folder search". I use folders in general because they don't change, and I usually know what I'm looking for. It (should be)/is also faster than searching all files. When I'm looking for a file or it's contents, I'll fall back to spotlight
- DavideNL 4y agoFyi, menu search in Alfred: https://github.com/BenziAhamed/Menu-Bar-Search https://github.com/BenziAhamed/Menu-Bar-Search
- behnamoh 4y agoI think Apple should just buy Raycast.
- insane_dreamer 4y agoOr Alfred, been around much longer.
- viktorcode 4y agoJust start typing the name. Not in the search field of Finder. You'll get focus on a file or folder that starts with whatever symbols you just typed. Very convenient and fast. Having "sort by name" by default in every folder helps a lot too.
- wyuenho 4y agoYou can just start typing in Finder, prefix search will Just Work.
- mcfedr 4y agoWhat's crazy, is that presumably, this is the default because some definition of "most people" just randomly save files all over the place
- wingworks 4y agoYep, most non tech people I've met often have files saved everywhere and anywhere. They don't know where stuff goes half the time.
- natch 4y agoin Terminal: find . -type f -name “somestring” but yeah that seems like more typing than one might want compared to a simple text entry field in the GUI.
- wlonkly 4y agoFor what it's worth, the terminal interface to the Spotlight database is "mdfind". It still doesn't solve GP's "only this directory" problem though. (But your "find" will search in and below the current directory for files that exactly match "somestring".)
- natch 4y ago>For what it's worth, the terminal interface to the Spotlight database is "mdfind". Yeah I realize that, but find is a stronger tool for the use case because it also allows wildcards to be specified in the name. >your "find" will search in and below Your "mdfind" will also search in and below the current directory. find also has -depth which can be used to tell it to search only this directory. mdfind has -onlyin to tell it what directory to search in, but it still recurses down. Does it have an option to limit this? Please do tell. >for files that exactly match "somestring" Well find also allows wildcards though. So not necessarily exactly… somestring is just an example. Does mdfind allow wildcards? Also find is fun to combine with grep to inspect file contents, especially since it has the -print0 option… find . -type f -name "*.py" -print0 | xargs -0 grep somestring Please tell me how to do this with mdfind, I would love to know!
- snoopy_telex 4y agoyou could also just have find run the grep for you as well `find . -type f -name \*.py -exec grep homestring {} \;` It's not exactly equivalent, however, I often will just use find directly for simple actions.
- wlonkly 4y agomdfind searches contents by default, thanks to the Spotlight index.
- m000 4y agoWhat do you mean "still mostly useless"? Is there anything more usable on any other OS? I moved back to Windows a couple of years back. Spotlight is the second thing I miss most from macOS, with the first being Preview.
- mehrshad 4y agoMicrosoft's PowerToys has a great answer to Spotlight on Windows if you're so inclined to try it out. [0] https://learn.microsoft.com/en-us/windows/powertoys/ https://learn.microsoft.com/en-us/windows/powertoys/
- fake-name 4y agoMentioned elsewhere, Everything search by voidtools: https://www.voidtools.com https://www.voidtools.com. It does funky things with monitoring some component of the NTFS filesystem to maintain a up-to-date index of every filename on your computer, and makes them searchable literally as fast as you can type. (https://news.ycombinator.com/item?id=33321000 https://news.ycombinator.com/item?id=33321000) There seems to be two kind of searching people do. Some people want a search tool that searches in documents. Some people want a search tool that searches filenames. Everything search is exclusively the second. I think I can count on one hand the number of times I've wanted to search inside documents in the last 10+ years (and for those cases, grep has worked fine, even on windows!). For some reason, searching inside documents seems to be the default for both windows and os x search, and it's super annoying.
- m000 4y ago> I think I can count on one hand the number of times I've wanted to search inside documents in the last 10+ years If you want to search documents you have created, I can imagine that you may not use the feature much. But e.g. for research papers, the downloaded copy rarely reflects the contents/authors, so it is really handy to be able to search the contents. > For some reason, searching inside documents seems to be the default for both windows and os x search, and it's super annoying. Weird. For me windows don't seem to search inside documents, or at least not in all documents.
- yodsanklai 4y ago> Spotlight is still mostly useless. I use it all the time to run binaries. For instance, "cmd-space mail". I wouldn't know the names of the files I want to search anyway.
- singularity2001 4y agoafter many years I still often type "⌘space email" and find nothing.
- tacker2000 4y agoIndeed. Also, Outloook for Mac also uses Spotlight to search emails and this seems to break for a lot of people. The only way to fix it is to do some command line mumbo jumbo like rebuilding the Spotlight index and deleting index folders.
- yawnxyz 4y agoSpotlight is great for those lone cold weather nights: whenever I feel down, it will start indexing and spin up all the fans and make a lot of heat and noise, making me feel warm and loved
- sbf501 4y agoI still use it as fast calculator. And sometimes it can convert units ... sometimes. That's it. I don't think it has EVERY found the file I'm looking for, but Windows search ain't much better. As someone who develops on all three OSes daily, nothing beats `find | grep` or `find | xargs grep`.
- dwaite 4y agoOne trick is to know that spotlight indexes content and metadata separately, and most search interfaces default to content. Typing in "README.md" in system spotlight will look for documents that contain a reference to that name, while "name:README.MD" will look for ones marked as _having_ that name. The search interface in finder has a builder for predicates (start a search then hit the plus on the right side of the search bar). There you can start to see some of the friendly prefixes for filesystem items such as extension:, kind:, date:, tag:. You can also see the mass of file specific metadata - like width, audio bit rate, city, genre. I have not, however, found a handy way to translate between English description, friendly prefix, and the internal query names like kMDItemContentType. Fun aside - some of these used to work in the Mac app store - for instance, you could search for listed applications which could open exotic document types. The "uselessness" IMHO is mostly in that it exposes the most simplistic interface possible, and people just don't know where to go from there (other than terminal users going `man mdfind` I suppose). That gap is only widened by how different it is from other filesystem-based mechanisms for power users, which have more established commonalities like regex and filesystem globbing.
- zestyping 4y agoI know you can specify these predicates; the problem is the absolutely terrible choice of default behaviour.
- regular 4y ago
- cr4nberry 4y agoImo grep and fd are the most consistent way, all these GUI apps do is get in the way and reinvent the wheel
- d12bb 4y agoAs you're already using fd for find, you may like ripgrep for replacing grep.
- garyclarke27 4y agoFinder and File organization is the worst part of Mac experience, it's terrible - I still can't get used to it after 3 years. Windows Explorer is so much better. Aswell as not searching the current folder, I find it so infuriating that Save-As does not default to the Current folder, just picks a random one!!
- mellavora 4y agofd https://github.com/sharkdp/fd#installation https://github.com/sharkdp/fd#installation assuming you are "in the current folder" in the terminal...
- chatmasta 4y agoPersonally I have Spotlight indexing completely disabled, except to index items in `/Applications` so I can use it as a quick-launcher. This was not easy to configure, and I'll probably have to do it again next time I update the OS. But it did seem to help with performance - Spotlight was often the cause of unpredictably high CPU usage spikes.
- boesboes 4y agoIf I'm recall correctly, it was pretty much perfect in the first few releases. It got worse and worse over the years when they added smart features. But maybe that more nostalgia than actual memories ;)
- bdlowery 4y agoThere’s one simple solution… buy Alfred.
- dev_tty01 4y ago>not start a sluggish scan of my entire hard disk A Spotlight search never starts a scan of your disk. The disk is always fully indexed and returns results out of the index very fast. The only exception is typically when the system is updated (or some other big event) and it reindexes everything. That being said, as others have pointed out, there is a setting to make a Finder window search apply only to the directory in the current window.