Force Spotlight to index hidden/invisible files/folders?

LoneWolf121188

macrumors 6502a
Original poster
Jun 7, 2007
664
0
Longmont, CO
I searched around on how to do this in 10.6, but the only things I could find were references to mdimport -f, which from what I understand is now obsolete. Any other ways to do this?
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
If Spotlight indexes the drive, that includes the system/hidden files. To search them, just add that criteria to your search.
Picture 1.jpg
 

maflynn

Moderator
Staff member
May 3, 2009
65,921
32,261
Boston
I also just go to that folder, as well.

For instance, I want to look for something in ~/Library. I go there first and start my search, it narrows the scope and gets me what I want faster w/o weeding through stuff I don't care about.
 

swiftaw

macrumors 603
Jan 31, 2005
6,311
21
Omaha, NE, USA
Hmmm...I don't see that little System Files option...is that screenshot from 10.5 or 10.6? And in any case, ~/Library isn't hidden. I'm talking about folders like ~/var, ~/usr, etc.
The System Files option isn't there by default, you have to add it by choosing Other from the search list then checking the appropriate Check Box.
 

xUKHCx

Administrator emeritus
Jan 15, 2006
12,587
6
The Kop
Hmmm...I don't see that little System Files option...is that screenshot from 10.5 or 10.6? And in any case, ~/Library isn't hidden. I'm talking about folders like ~/var, ~/usr, etc.
Spotlight changed it behaviour to the current in 10.5.

You have to enable this option.

Yup there is but it's still pretty annoying. Apple should have it on by default.

Step 1: Go to the Finder Search (Command + F or File > Find)

Step 2: Click on the "Kind" drop-down menu and click on other.
Note: If you don't see this pop up button, then make click on the "+" button right after Save.

Step 3: You'll see a dialog pop up and find System files. Once there, select the checkbox. Now go back to the search Window by clicking on the OK button.

Step 4 Make sure that the System files is selected in the first drop down menu. Now proceed to the Second drop down menu and select "include".

Now you can search for all your system files but don't expect for this to work with spotlight. Furthermore, you'll have to manually do this every time (only step 4 actually) you wish to search for something in your system. Hope this helps!
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
Hmmm...I don't see that little System Files option...is that screenshot from 10.5 or 10.6? And in any case, ~/Library isn't hidden. I'm talking about folders like ~/var, ~/usr, etc.
It's the same in 10.5 and 10.6, as xUKHCx said. The steps xUKHCx quoted will enable you to find system files in a search. If you're talking about showing the hidden files and folders in Finder, type the following in Terminal, pressing Enter after each line:
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder​
To hide them again, repeat the process, replacing TRUE with FALSE
 

amitseven

macrumors newbie
May 15, 2010
2
0
It's the same in 10.5 and 10.6, as xUKHCx said. The steps xUKHCx quoted will enable you to find system files in a search. If you're talking about showing the hidden files and folders in Finder, type the following in Terminal, pressing Enter after each line:
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder​
To hide them again, repeat the process, replacing TRUE with FALSE

this looks like it should solve my 50-gig mystery, but it didn't work with a simple cut and paste into the terminal window. sorry, newb here, any details i'm missing?
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
this looks like it should solve my 50-gig mystery, but it didn't work with a simple cut and paste into the terminal window. sorry, newb here, any details i'm missing?
Did you paste one line at a time, pressing enter after each?
 

Hal Itosis

macrumors 6502a
Feb 20, 2010
902
4
It's the same in 10.5 and 10.6, as xUKHCx said. The steps xUKHCx quoted will enable you to find system files in a search. If you're talking about showing the hidden files and folders in Finder, type the following in Terminal, pressing Enter after each line:
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder​
To hide them again, repeat the process, replacing TRUE with FALSE
this looks like it should solve my 50-gig mystery, but it didn't work with a simple cut and paste into the terminal window. sorry, newb here, any details i'm missing?
You may have better luck using the form that specifies the type of the data:

defaults write com.apple.finder AppleShowAllFiles
-bool TRUE

[otherwise 'TRUE' might get written as a string ("true") instead of a boolean (1).]

Edit: if that doesn't "work" immediately, try relaunching Finder.
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
You may have better luck using the form that specifies the type of the data:

defaults write com.apple.finder AppleShowAllFiles
-bool TRUE

[otherwise 'TRUE' might get written as a string ("true") instead of a boolean (1).]

Edit: if that doesn't "work" immediately, try relaunching Finder.
The command will work, with or without the -bool
However, I'm guessing he forgot to relaunch Finder afterwards.
 

amitseven

macrumors newbie
May 15, 2010
2
0
tried it again and it worked - files that were previously invisible can now be seen. library says 53 gigs though, and i can barely account for half that. the search continues...
 

Hal Itosis

macrumors 6502a
Feb 20, 2010
902
4
The command will work, with or without the -bool
Historically true.

However -- around the time Leopard was released -- some users began reporting it had stopped working, and folks (in a few threads around that time) speculated that Apple may have disabled that particular hack. But then the solution turned out to be that simply specifying the -bool type made it work again. In any event: including the type specification is the "canonical" form, and should be encouraged. [i.e., i wouldn't expect it to work otherwise.]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.