linux常用命令less选项


-N  ........  --LINE-NUMBERS
                  Use line numbers. 显示行号.


-m  -M  ....  --long-prompt  --LONG-PROMPT
                  Set prompt style.  读取文件的百分比,行号及总行数.



q  :q  Q  :Q  ZZ     Exit.

  j    Forward  one line   (or N lines).
   k    Backward one line   (or N lines).
  f   Forward  one window (or N lines).
  b    Backward one window (or N lines).



 /pattern          *  Search forward for (N-th) matching line.
  ?pattern          *  Search backward for (N-th) matching line.


 g  <  ESC-<       *  Go to first line in file (or line N). 按了g,再输入行号.看看跳转行号效果
  G  >  ESC->       *  Go to last line in file (or line N).

一般情况下用 less file或者less -MN file.

相关内容