Line count for each file To get wc -l for each file in the directory: wc -l *.csv To output the number of lines, sorted in decreasing order: wc -l *.csv | sort -rn