Word count on Windows shell

Viewed 170

What is the Windows equivalent of the wc linux command? I have tried

find /c /v "" file.txt

but it doesn't work: the format of the parameter isn't correct. I have also tried

find --% /c /v "" file.txt

and it does work, but when I try to use this command with other commands, it doesn't work. For example:

sort file.txt | Unique | find --% /c /v ""

In this way, it counts 0 words, even if the file contains more. Can someone please help me?

1 Answers

In powershell it should be:

Get-Content <filename> | Measure-Object –Line

I'm not aware of any proper wc equiv in classical windows shell.

Related