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

前端 未结 6 1757
余生分开走
余生分开走 2021-01-29 17:09

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

6条回答
  •  一向
    一向 (楼主)
    2021-01-29 17:55

    You can also press = while less is open to just display (at the bottom of the screen) information about the current screen, including line numbers, with format:

    myfile.txt lines 20530-20585/1816468 byte 1098945/116097872 1%  (press RETURN)
    

    So here for example, the screen was currently showing lines 20530-20585, and the files has a total of 1816468 lines.

提交回复
热议问题