Websitetemplate.org

Welcome > Linux > sed Magic > sed: number each line of a file

sed: number each line of a file

(simple left alignment). Using a tab (see # note on 't' at end of file) instead of space will preserve margins.
sed = filename | sed 'N;s/n/t/' 
Ref: http://www.student.northpark.edu/pemente/sed/sed1line52.txt

Content Copyright 2003-2014 George Toft