Windowsでファイルの行数を表示する方法を紹介します。 1.問題点 Linuxでファイルの行数を表示するには、wcコマンドが用意されています。 たとえばindex.htmlの行数を表示する場合、「wc -l ファイル名」と入力すれば行数が表示されます。 % wc -l index.html 実行結果 2036 index.html ですが、Windowsでファイルの行数を表示する方法が分かりません。 2.Windowsでファイルの行数を表示する WindowsではLinuxのようなwcに相当するコマンドが用意されていません。 が、次のようにtypeコマンドとfindコマンドを組み合わせることで行数を表示することができます。 C:\>type ファイル名 | find /c /v "" たとえばindex.htmlの行数は次のようにしてカウントします。 C:\>type index.ht