You can use "wc -l" to count to number of lines in a file.
Example:
$ wc -l covariates.txt20783244 covariates.txt
$ wc -l covariates.txt
20783244 covariates.txt