问题
I know the command in Unix/Linux systems is "wc" but that doesn't work in Windows.
回答1:
The closest I know of is the PowerShell equivalent Measure-Object.
回答2:
find command could be used in windows cmd to find line count (with the /c switch), word count etc.
http://rickardnobel.se/counting-lines-in-windows-command-prompt/
回答3:
"Find" will be able to do the task similar to word count as RRM told.
Eg.
Query user | find /v /c ""
/v – Show any lines that don’t contain the string of words you specified. /c - Count the number of lines that matches the word in fine.
Query user | find /i "active" /c
/i - Ignore case /c - Count the number of lines that matches the word in fine.
回答4:
wc is part of the GNU Core Utils for Windows. I often install GnuWin32 utilities on Microsoft Windows systems to supply equivalents to the commands I use regularly on Linux and OS X systems.
来源:https://stackoverflow.com/questions/29177443/how-do-i-do-a-word-count-command-in-windows-command-prompt