I am trying to make my Windows System as compatible with existing Makefiles as possible. One great step that is missing is replacing the windows "find" (which is the same as grep) with the GNU find (list of all files in directory and sub directories). Is this possible? (I already have msys find installed and ready to go. Just removing system32/find.exe would probably work, but unfortunately it is not possible that easily)
2 Answers
Rather than removing Windows' find.exe, I strongly recommend putting GNU in your path before Windows\System32. For example, with Cygwin, you can use something like:
path c:\cygwin\bin;c:\windows\system32;c:\windows;c:\program files\foo;c:\program files\bar;c:\windows\system32\wbem
-
No need to do this manually, of course—it’s simply how this stuff works. From MSYS’
/etc/profile
:export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
– Daniel BAug 10, 2014 at 13:19 -
1If you go this route, it's better to limit the scope as much as possible. Don't change
PATH
for the entire system; change it only for the application you use (e.g. have a special batch file to launch a prompt withset PATH=\path\to\cygwin;%PATH%
). This limits potential surprises later when you or someone else expects a Windows utility and instead gets a *nix one.– BobAug 10, 2014 at 14:56
You can gain access to all protected files by changing the ownership.
For Windows 7, on the file or folder that you want to edit:
- Go to Properties->Security->Advanced->Owner
- Change owner to either Administrators or your own User
- On Properties->Security grant rights to the new owner
Source: Windows 7 – How to Delete Files Protected by TrustedInstaller
-
2Please include necessary steps in your answer. If the link dies at some time your answer will become much less useful. Aug 10, 2014 at 12:27
-
And then any Windows Update (be it a bug fix, security fix, Service Pack or otherwise) could replace find.exe with the "correct" version again. This is a "global" solution to a "local" problem and they're invariably always a bad idea..– RobAug 10, 2014 at 15:09
-
2You guess why I marked salehigal's answer as correct?, Mine is the solution to the problem I asked for, salehigal's solution is for the problem I actually had. Aug 10, 2014 at 15:29
bash.exe
orsh.exe
then usingfind
will invoke the GNU find instead of the Win32 find.sh.exe
andbash.exe
come withgit
or MinGW.