Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

maya90

macrumors member
Original poster
Feb 16, 2011
58
3
hi,

Mac Find (ctrl-F from Finder) can't find any existing files or folders in this path (from my Time Machine backup external HD):

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/
(which is root of my PHP env, i.e., in my machine it's
Macintosh HD/Library/WebServer/Documents/)

if I search even for dirs "Library" or "WebServer" under
/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/
(& choose "file name" option) it doesn't find them.. why is this... it's truly baffling....

it can find existing files and folders inside here, np
/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Developer/

but it finds no existing files or folders here,
/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/


am stumped.. would appreciate some enlightenment here

(would also like to know what the command is to run this find-file command in unix.... I just need to search for a file name (or partial file name) down a certain path from curr dir (i.e., in subfolders of dir I am in on the unix shell..)

thank you....
 
but it finds no existing files or folders here,
Code:
/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library

Spotlight doesn't include system files in search results, and it's smarter than you'd expect at dealing with Time Machine backups.

You need to do the following to get it to behave the way you want:
  • Make sure to start the search (press cmd+F) from inside the specific backup you're searching (ie. one of the folders named like 2015-01-20-142443). Switch the search toggle from "This Mac" to the name of the folder.
  • Click the plus button to add a new rule. Change the rule to "System files are included" (you'll need to click "Other..." when changing "Kind").

(would also like to know what the command is to run this find-file command in unix.... I just need to search for a file name (or partial file name) down a certain path from curr dir (i.e., in subfolders of dir I am in on the unix shell..)


The bash command you're looking for is:
Code:
find /path -name expression
This will traverse the directory tree starting at /path for anything with a name matching expression. For example, to find all the Word documents on my Desktop, I'd run:
Code:
find ~/Desktop -name *.docx
 
Spotlight doesn't include system files in search results, and it's smarter than you'd expect at dealing with Time Machine backups.

You need to do the following to get it to behave the way you want:

[*]Make sure to start the search (press cmd+F) from inside the specific backup you're searching (ie. one of the folders named like 2015-01-20-142443). Switch the search toggle from "This Mac" to the name of the folder.

actually, this would beat the whole purpose of my search.. since I don't know on what date the file is that I'm searching for was backed up (i.e., in what date dir it is...;-)


The bash command you're looking for is:
Code:
find /path -name expression
This will traverse the directory tree starting at /path for anything with a name matching expression. For example, to find all the Word documents on my Desktop, I'd run:
Code:
find ~/Desktop -name *.docx
[/QUOTE]

yes I found unix file-find commands online the other day.. but I also realized: Apple does something very very very stupid: which is: Macintosh HD... there's a space in there.. which means unix will not be able to navigate to this dir... YIKES... HOW ON EARTH can the Apple do this??? knowing dirs/files with spaces in their names are a big no-no in unix?? oh brother.. (I haven't tried yet, but this is my assumption..)

thank you for your response....
 
Last edited:
yes I found unix file-find commands online the other day.. but I also realized: Apple does something very very very stupid: which is: Macintosh HD... there's a space in there.. which means unix will not be able to navigate to this dir... YIKES... HOW ON EARTH can the Apple do this??? knowing dirs/files with spaces in their names are a big no-no in unix?? oh brother.. (I haven't tried yet, but this is my assumption..)

No, this is fine. A Unix filename can contain any character except the forward slash (/) and the nul character (\0).

There are a few characters in Unix that have special meaning:
Code:
space * [ ] ( ) -
to name a few.

If you want to include these characters, you have to "escape" them with a backslash:
Code:
cd Folder\ with\ spaces
or quote the expression:
Code:
cd "Folder with spaces"

Also, the path to Macintosh HD is simply "/". "Macintosh HD" won't get you anywhere.

----------

actually, this would beat the whole purpose of my search.. since I don't know on what date the file is that I'm searching for was backed up (i.e., in what date dir it is...;-)

Sorry, didn't notice you'd replied to this as well.

Try searching from the directory containing the date folders then. This should be named after your computer.
 
Also, the path to Macintosh HD is simply "/". "Macintosh HD" won't get you anywhere.

yes I know.. this applies to the computer, but in my external hard drive I need to get here,

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/

not sure unix will go along with this.. am not home now, will try when I get home...
 
/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/

not sure unix will go along with this.. am not home now, will try when I get home...

You will just need to escape the space:
Code:
cd /Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/[B]Macintosh\ HD[/B]/Library/WebServer/Documents/
or enclose the whole path in quotes:
Code:
cd [B]"[/B]/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/[B]"[/B]
 
remember: I need to search, not just navigate to a dir..

however, I just tried searching in unix in the external backup drive.. it takes a very long time, as it searches the system dir and everything (since everything is backed up) under every backup date.. and get "permission denied" for all these "weird" dirs...

oh well.. but it does run the search properly in unix..

so: back to my original question: why is it that when I search in Finder it seems to completely skip this dir?

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/

but not this one:

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Developer/

????

and is there anything I can do about this...

many thanks for your help....
 
Last edited:
remember: I need to search, not just navigate to a dir..

The rule about escaping spaces applies whenever you use a filepath, no matter what command you're using.

however, I just tried searching in unix in the external backup drive.. it takes a very long time, as it searches the system dir and everything (since everything is backed up) under every backup date.. and get "permission denied" for all these "weird" dirs...

Use sudo to run find as root. That will get rid of the permission problems.
Code:
sudo find . -name expression

so: back to my original question: why is it that when I search in Finder it seems to completely skip this dir?

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/

but not this one:

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Developer/

Because Spotlight regards the Library folder as system files that you shouldn't be interested in. It doesn't show them to you unless you explicitly tell it to by setting the rule described above.
 
Because Spotlight regards the Library folder as system files that you shouldn't be interested in. It doesn't show them to you unless you explicitly tell it to by setting the rule described above.

unbelievable... my PHP environment is in this path!!

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/
(this is where the mac put it.. I haven't changed anything..)

i.e., in my machine it's at:
/Library/WebServer/Documents/

how can I not "be interested" in a dir where my PHP env is, where I code and develop web pages and such? very very stupid.. someone wasn't thinking here..

(also very very stupid root of PHP env is called "Documents"....)

oh brother.... ok.. thank you...
 
(also very very stupid root of PHP env is called "Documents"....)

I've thought things like this before when coming across new frameworks. From experience though, if you think something looks stupid it's either because you're using it wrong or you're using it for a very niche purpose.

/Library/WebServer/Documents is the document root for the Apache web server. You could write a website in ASP or Python instead of PHP in there.

I guess it's similar to why a hard drive isn't called a "Word document box".


how can I not "be interested" in a dir where my PHP env is, where I code and develop web pages and such? very very stupid.. someone wasn't thinking here..

The way I see it, all of the default behaviours on the Mac are tuned for the casual semi-literate computer user. It doesn't expect you to want to be running advanced wi-fi diagnostics or manually editing plist files in the system library, so it doesn't throw the option in your face unless you explicitly ask it to, eg. by setting the "show system files" rule. As a developer, it expects you to know what you're doing well enough to look after yourself.
 
unbelievable... my PHP environment is in this path!!

/Volumes/WD_2_TB_TIme_Machine/Backups.backupdb/<myMBP>/<backupDate>/Macintosh HD/Library/WebServer/Documents/
(this is where the mac put it.. I haven't changed anything..)

i.e., in my machine it's at:
/Library/WebServer/Documents/

how can I not "be interested" in a dir where my PHP env is, where I code and develop web pages and such? very very stupid.. someone wasn't thinking here..

(also very very stupid root of PHP env is called "Documents"....)

oh brother.... ok.. thank you...

Yep... this also bothers me. But the best practive is installing another PHP/LAMP environment, so OSX updates won't mess with your environment. Installing via macports should be the right thing to do.

But I'm OCD when saving storage space, so I use the bundled PHP/Apache too. It required me recompiling some PHP extensions when I upgraded to Yosemite. I also store my scripts on an encrypted sparsebundle, so my Documents folder is a symbolic link to /Volumes/MySparseBundleName.
 
well I found this,
https://discussions.apple.com/thread/3286394

but it didn't help... ctrl-F still can't find Macintosh HD/Library/ or anything inside it....
even after restarting my machine it's not working..

OP here is on 10.7.1, I'm on 10.6.8... could that make a difference?

(still fail to understand how a development environment can be in a hidden dir.. this really does not make any sense... why this dir is also hidden in an external HD also doesn't make sense to me...)

thanks again for your help...

PS: this Macintosh HD/Library/ dir is not hidden at all in my Finder in my machine.. so this
http://www.collectorz.com/movie/faq.php?qid=522
doesn't even apply to me.... (funny, I don't see it in that "go" menu when I do option-go, but I can still navigate to it fine from Finder, like to any other dir... go figure....)
 
well I found this,
https://discussions.apple.com/thread/3286394

but it didn't help... ctrl-F still can't find Macintosh HD/Library/ or anything inside it....
even after restarting my machine it's not working..

Both this thread and the other are talking about the user library folder, which is located at /Users/username/Library. You're using the system library folder at /Library.

As I said before, you can tell Finder to include results from /Library (or the Library in your Time Machine backup) by adding the "System files are included" rule. See the attached screenshot.

(still fail to understand how a development environment can be in a hidden dir.. this really does not make any sense... why this dir is also hidden in an external HD also doesn't make sense to me...)

If you're that opposed to having it there then you can move it by editing the /etc/apache2/httpd.conf file.
 

Attachments

  • screenshot.png
    screenshot.png
    98.3 KB · Views: 73
ok, that worked... thank you...:)

however: I can't try on the external drive, b/c whenever I search, no matter what dir I'm in, the search goes to "Documents".. so the three options are "Documents", "This Mac", or "shared".. (& obviously "This Mac" does not include any external HD..) this is not the first time this happens..

even on the computer now, whatever dir I'm in when I go to search, it goes to "Documents".. oh brother...:-(

bottom line here is, you should be able to choose what folder to search in -- after you have pressed command-F... the computer shouldn't choose for you...


oh man.. so I still haven't been able to do my search in
external HD/........../Library/...... solve one prob, get another....:-(


still, many thanks for your help... you have been very helpful...

(PS: when tried this command you suggested in unix
sudo find . -name expression
it asked for my password.. I assumed this was my computer password.. I typed it in... but unix just hanged.. nothing happened.. then when tried to eject external HD, it said it couldn't eject it, because a progr was using it, even though I had quit terminal.. this was scary.. had to force-eject it...

so sudo command would be something like

Code:
sudo find . -name '*.css'

??

thank you..
 
Last edited:
however: I can't try on the external drive, b/c whenever I search, no matter what dir I'm in, the search goes to "Documents".. so the three options are "Documents", "This Mac", or "shared".. (& obviously "This Mac" does not include any external HD..) this is not the first time this happens..
oh man.. so I still haven't been able to do my search in
external HD/........../Library/...... solve on prob, get another....:-(

That shouldn't be happening. Try going to Finder preferences and change "when performing a search" to "search the current folder" (as shown in the attached screenshot). See if that makes it behave.

(PS: when tried this command you suggested in unix
sudo find . -name expression
it asked for my password.. I assumed this was my computer password.. I typed it in... but unix just hanged.. nothing happened.. then when tried to eject external HD, it said it couldn't eject it, because a progr was using it, even though I had quit terminal.. this was scary.. had to force-eject it...

Believe it or not, this is actually everything working fine. When you type a password into bash (this applies on any Linux box as well), it won't show you what you're typing. If you're not used to it then it just looks like it's crashed. Type your password as usual and hit enter at the end.

There was probably a lingering process still active on the external drive. Nothing to worry about.

so sudo command would be something like

Code:
sudo find . -name '*.css'

Very, very nearly! Just without the quotes around the *.css:
Code:
sudo find . -name *.css
 

Attachments

  • screenshot.png
    screenshot.png
    45.6 KB · Views: 84
That shouldn't be happening. Try going to Finder preferences and change "when performing a search" to "search the current folder" (as shown in the attached screenshot). See if that makes it behave.

I already have it set to that..... :eek:


Believe it or not, this is actually everything working fine. When you type a password into bash (this applies on any Linux box as well), it won't show you what you're typing. If you're not used to it then it just looks like it's crashed. Type your password as usual and hit enter at the end.

There was probably a lingering process still active on the external drive. Nothing to worry about.



Very, very nearly! Just without the quotes around the *.css:
Code:
sudo find . -name *.css


ok.....


again, thank you very much for your help.....
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.