If I'm in the root directory, can I use find to search all the directories below it for a file?
I tried find stdio.h but it didn't find anything. However I know that that file is in the filesystem somewhere. How do I find it?
Answer
It's in /usr/include/stdio.h
, but for future reference run
$ locate stdio.h
Don't forget to run updatedb
first. On Cygwin, you'll want to run it as Administrator.
To look in the current directory and its children:
$ find . -name stdio.h
To look everywhere beneath the root directory:
$ find / -name stdio.h
You tagged this as a Cygwin question, so to search the entire C drive, you could run
$ find /cygdrive/c -name stdio.h
but that's likely to be much slower than searching from an Explorer window.
No comments:
Post a Comment