How to get “wc -l” to print just the number of lines without file name? October 16, 2022 by Tarik Try this way: wc -l < file.txt