Give line numbers to a text file Commands Add comments Jan 212010 Give line numbers to a text file Answer: To add line numbers to a text file, you can use the nl command. # nl input.txt Related posts: How to sum a file of numbers? How to add line number to a text file? Convert DOS/MAC to UNIX text file format converter Convert Windows text file to UNIX format without dos2unix Print sequences of numbers in Linux 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>