cat with line numbers code example Example 1: cat along with line numbers cat -n <filename> Example 2: how to show lines on cat command bash$ cat -n file.txt