User Tools

Site Tools


sed:count_lines_in_a_file

SED - Count - Count lines in a file

Emulates “wc -l”.

sed -n '$=' filename

Example

Running that command again this file:

testfile
aaa
bbb
ccc

returns:

3
sed/count_lines_in_a_file.txt · Last modified: 2020/08/16 13:33 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki