Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Windows Explorer, when I search for libstdc++-6.dll, it returns half a dozen results. I'm trying to do a similar filename search in Cygwin with find, but that shows no results.

find / -name libstdc++-6.dll

Is my syntax correct?

This should invoke Cygwin find, as which find returns /bin/find.

Update

find /c/strawberry/ -name libstdc++-6.dll works, just not from root.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Your syntax is correct; the gotcha here is a bit of weirdness with Cygwin's view of the filesystem.

In Cygwin, the root directory / points to what, in the Windows filesystem, is the root of your Cygwin install, which is usually c:\cygwin. To access anything outside that, you canonically have to use /cygdrive/[drive letter]; for example, the c:\windows\system32 directory's path within Cygwin is not /c/windows/system32 but rather /cygdrive/c/windows/system32.

A common way of circumventing this annoyance is to create symlinks in / which point to various drive letters in /cygdrive, e.g. ln -s /cygdrive/c /c; if you're able to access files outside the Cygwin root with paths such as /c/windows/..., it's because such symlinks exist, whether created by hand or automatically.

This scheme works well for most purposes, but not all programs automatically follow symlinks, and find is such a program; find /c/strawberry/ ... works because you're starting find off on the 'far' side of the symlink, but find / ... doesn't because it starts out on the 'near' side and won't by default follow the /c symlink. To produce the desired behavior, pass the -L option to find; find -L / -name libstdc++-6.dll should turn up the same results as find /c/strawberry -name libstdc++-6.dll will.

share|improve this answer
    
Thanks dude! Unfortunately, Git Bash's find does not seem to have a -L option. –  mcandre May 7 '13 at 18:06
    
Cygwin's find does, I'm pretty sure; if that's what you're invoking, as described in your question, then it should be working properly. If your Cygwin install came with Git Bash, then I have no idea what weirdness it's inflicting on you, and my advice is to ditch the training wheels and just install real Cygwin, whose package manager offers the git client. –  Aaron Miller May 7 '13 at 18:11
    
Oh, hey, Git Bash comes with MSYS, which compares with Cygwin roughly as Minix compares with Linux. I'd definitely ditch Git Bash and install Cygwin, along with the Cygwin git client. –  Aaron Miller May 7 '13 at 18:25
1  
Not having a Windows box handy at the moment, I can't, no. But I can say that Cygwin, by design, provides a much more complete *nix environment than MSYS does, also by design. If you just want to use the git command-line client, Git Bash will suffice; if it's a more general *nix interface you're after, such as being able to use find instead of Windows Search, then Cygwin's going to do a better job fulfilling that desire. –  Aaron Miller May 7 '13 at 18:49
1  
That's more of a major religious war, I'd say. :) There's a qualitative difference, though; while you can pretty much do in Vim whatever you'd do in Emacs, or vice versa, the same really isn't true of MSYS and Cygwin. –  Aaron Miller May 7 '13 at 19:06
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.