wcコマンドでファイルの行数をカウントする方法
wcコマンドでファイルの行数をカウントするには-lオプションを指定します。
オプションの説明
-l, --lines print the newline counts
-lオプションを指定した場合
$ cat test.txt a b c $ wc -l test.txt 3 test.txt $ cat test2.txt a b c $ wc -l test2.txt 4 test2.txt
wcコマンドでファイルの行数をカウントするには-lオプションを指定します。
オプションの説明
-l, --lines print the newline counts
-lオプションを指定した場合
$ cat test.txt a b c $ wc -l test.txt 3 test.txt $ cat test2.txt a b c $ wc -l test2.txt 4 test2.txt