Sometimes having line numbers can be useful. The nl command is helpful in this case, but depending on whether or not it’s the GNU version may mean that blank lines are not counted.
To get around this issue, you can issue the command below:
nl -ba
If you’re running GNU nl then you likely won’t have that issue and a simple
nl
will work.