We all know that in Linux, the number of text lines can be wc-l command, for example:
-bash-3.2$ Cat Pif_install.log | Wc-l
712
But how to count the number of lines of output text under Windows, the answer is to use the FIND/C command
1. Count The number of rows that contain a string . For example, the number of time_wait when a network connection is counted
Netstat-an | find/i/C "Time_wait"
Here the/I parameter is case-insensitive, and the/C parameter is a count of the number of rows or records that contain the "time_wait" string.
2. Count all rows . Find has an option./C, which means the number of rows that do not contain a string, which can be used to count the number of lines of text, for example:
C:\users\nr>type Test.txt | find/v/C ""
253
Note: Empty lines in the file are counted correctly in addition to the last blank line, and the remaining empty rows are statistically correct.
Commands for counting the number of rows under Windows