Tomás
Tomás

Reputation: 375

Problem with <command> | find in windows which results in "FIND: parameter format incorrect"

Today I found a strange problem where I can't pass the output of any command to find. Found this when trying to use pip list | found /i "pyinstaller" which resulted in FIND: formato de parámetros incorrecto or FIND: parameter format incorrect. Then went to the Microsoft documentation (https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/find) and saw there was nothing wrong with it (apparently) so I decided to try the example that was most similar to mine in the docs (which would be tasklist | find /v /i "agent") and got the same result.

Looked for this behavior but couldn't find anything in particular about it, so it must be a stupid error from my part, so I'm hopping someone can point me out what is that I'm overlooking

P.S. grep > find, change my mind if you can

Upvotes: 1

Views: 2202

Answers (2)

Anogoya Dagaate
Anogoya Dagaate

Reputation: 107

Like the previous commenter said the 'find' equivalent for Powershell is 'Select-string' so netstat -ano -p TCP | select-string '8080' should do it.

Upvotes: 2

cartbeforehorse
cartbeforehorse

Reputation: 3487

You're using PowerShell, I think. If you used Windows standard command line, it would work.

In PowerShell, it seems that you have to escape the double-quotes:

pip list | found /i `"pyinstaller`"

see also: https://serverfault.com/questions/758267/powershell-pipe-into-find-exe-command

Go figure!

Upvotes: 2

Related Questions