添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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?

thank you! I tried this command and it works when I use it alone, but when I use it with the other commands I wrote in the first post, then it counts 0 :( Irene Dec 14, 2021 at 16:41 I'm not near any windows machines at the moment, so i cannot try; but judging by the "man" page; perhaps @( $( foreach ($line in Get-Content C:\test.txt) { $line.tolower().split(" ") }) | Sort-Object | Get-Unique ).length Raxi Dec 14, 2021 at 17:27

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .