Use this command to add line numbers to a text file…


sed = filename.txt | sed 'N;s/\n/\t/' > filename_number.txt

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

## 3 thoughts on “Add Line Numbers”

1. could you kindly break down the ‘N;s/\n/\t/’ part … i understand you want to substitute \n with \t … what is the N; there for ?