Given the following ...
$ less -N file.txt
1 first line
2 second line
3 third line
4 fourth line
file.txt (END)
... I'd like to do something like this:
$ less -N --STARTING-NUMBER=0 file.txt
0 first line
1 second line
2 third line
3 fourth line
file.txt (END)
In other words, I'd like to be able to specify which value the line numbering starts from.
Note that this is possible using nl
:
$ nl -v 0 file.txt
0 first line
1 second line
2 third line
3 fourth line
But -N
in less
can be toggled on and off without leaving less
, whereas if I pipe the above into less
, the line numbers could not be toggled off.
If less
has something like nl
's -v
option - or there were any other way to achieve the same - that would be awesome. But I don't see it in the less(1)
man pages.