VOOZH about

URL: https://dev.to/al-chris/adding-grep-and-rip-grep-to-windows-cmd-and-pwsh-just-because-4mbj

⇱ Adding Grep and Rip-Grep to Windows CMD and pwsh (Just Because) - DEV Community


I recently added grep and rip-grep to Windows. I can now use them directly in CMD and pwsh.

Getting rip-grep working was easy, I just ran:

wingetinstallBurntSushi.ripgrep.MSVC

For grep, I knew I could already use it within Git, but I wanted to use it directly from CMD and pwsh. Why? Just because.

So, I went to copy grep.exe from the Git folder on my PC to a folder that already exists in path. I copied it to C:\Windows\System32 (aka %SystemRoot%) from C:\Program Files\Git\usr\bin.

I went to CMD to test it and was immediately met with a flurry of library (.dll) doesn't exist windows.

To fix this, I created a dedicated grep folder in System32 and moved grep.exe and all the .dll files mentioned in those error windows there. Then, I added the grep folder I created to my path (%SystemRoot%\grep), and reopened CMD and pwsh to test it.

And sure as sunlight, it worked.

(Why is system root still windows32?)