简体   繁体   中英

How do I do a “word count” command in Windows Command Prompt

我知道Unix / Linux系统中的命令是“wc”,但在Windows中不起作用。

我所知道的最接近的是PowerShell等效的Measure-Object。

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/

"Find" will be able to do the task similar to word count as RRM told.

/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.

/i - Ignore case /c - Count the number of lines that matches the word in fine.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM