(Video materials in preparation)
lcnt : Counts lines (rows)
Usage : lcnt [-f] <file> ...
Version : Tue May 23 23:11:25 JST 2017
Edition : 1
Counts the number of lines (records) in the text data input from
the file specified in the argument or standard input.
(Original Data)
$ cat data
0000000 Smith______ 50 F 91 59 20 76 54
0000001 Jones______ 50 F 46 39 8 5 21
0000003 Wilson_____ 26 F 30 50 71 36 30
0000004 Drake______ 40 M 58 71 20 10 6
0000005 Hawking____ 50 F 82 79 16 21 80
0000007 Newton_____ 42 F 50 2 33 15 62
$ lcnt data
6
Count the number of lines (records) in multiple files at once.
(Original Data 1)
$ cat data1
1 file1
2 file1
3 file1
(Original Data 2)
$ cat data2
1 file2
2 file2
(Original Data 3)
$ cat data3
1 file3
2 file3
3 file3
4 file3
$ lcnt data1 data2 data3
3
2
4
If you use the -f option the file name and line count are both
output.
$ lcnt -f data1 data2 data3
data1 3
data2 2
data3 4
If you specify - as the file name, the command reads standard input.
$ cat data2 | lcnt -f data1 - data3