How to display line numbers in 'less' (GNU)

Alex. S. picture Alex. S. · May 6, 2009 · Viewed 339.1k times · Source

What is the command to make less display line numbers in the left column?

Answer

dirkgently picture dirkgently · May 6, 2009

From the manual:

-N or --LINE-NUMBERS Causes a line number to be displayed at the beginning of each line in the display.

You can also toggle line numbers without quitting less by typing -N.

It is possible to toggle any of less's command line options in this way.