Linux, display (text) file lines number command line

This how to display any (text) file line number via command line:

sed -n '$=' filename.extension