Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you know a similar program for wc (unix word count command) on Windows? [closed]

Tags:

windows

cmd

A quick search gives me tawbaware wc, but it does not accept stdout as input stream, meaning I can not use pipe within a DOS session.

Note:

I can not install cygwin or use powershell (which would have allowed a '|foreach-object {(get-content $_).count}')

unxutils and and gnuwin32 Packages might have this feature...

like image 628
VonC Avatar asked Oct 29 '08 15:10

VonC


People also ask

What is the equivalent of wc in Windows?

The Linux/Unix "line count" command, wc -l , has a Windows equivalent find /c /v "" .

How do I check word count in Unix?

The wc (word count) command in Unix/Linux operating systems is used to find out number of newline count, word count, byte and characters count in a files specified by the file arguments. The syntax of wc command as shown below.

How do you count only words in wc?

Display number of word count only of a file: We all know that this can be done with wc command having -w option, wc -w file_name, but this command shows two-columnar output one is count of words and other is file name. So to display 1st column only, pipe(|) output of wc -w command to cut command with -c option.

Which command is used for word count?

Use the wc command to count the number of lines, words, and bytes in the files specified by the File parameter. If a file is not specified for the File parameter, standard input is used.


2 Answers

Even easier, find /c. ex:

netstat -an | find /c "ESTABLISHED" 

find /c: Displays only the count of lines containing the string.

like image 88
jeff drake Avatar answered Sep 21 '22 15:09

jeff drake


You can use the original "wc", built for windows: it is part of the coreutils package. Get the most recent coreutils exe.

like image 31
florin Avatar answered Sep 18 '22 15:09

florin