will print out the number of lines in <file>.
wc -l <file>
If you have a collection of files (.csv in the example below), and want to know how many rows are in each file, the command:
will print out a list of all the files ending in .csv, along with the number of lines in them.
for f in *.csv; do wc -l $f; done
To print the number of lines, without the filename, the cut command can be used, with the following parameters:
cut -d' ' -f1
Combining them, we can use:
to print out just the number of lines in each file ending in .csv in the directory.
for f in *.csv; do wc -l $f |cut -d' ' -f1; done