How to count the number of line in a file Commands Add comments Jan 162009 How to count the number of line in a file Answer: Use the wc command wc -l text.txt Related posts: How to count the number of duplicated lines in a file How to add line number to a text file? Count the number of matching lines from grep Count the total number of logged in user How to count the number of files in a directory? Leave a Reply Cancel reply Name (required) E-mail (required) URI Your Comment You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>