2

Here is the behaviour im seeing:

http://www.giphy.com/gifs/MWuSbME041h8cmDqer

A short description is that when i type man bash | less, i need to type

::100

instead of

:100

in order to move to line 100.

I've tried googling it but couldnt really come up with sane search terms and it yielded nothihng.

Any ideas ?

My version of less is:

less 487 (POSIX regular expressions)
  • 1
    @guiverc man doesn't have its own pager, it uses the pager set in $MANPAGER, $PAGER or the one the alternatives system provides (which is less by default), whichever is set, in this exact order. As I explain in How can I get help on terminal commands? to use a specific pager one should use e.g. man -P less bash. – dessert Feb 28 '18 at 11:45

1 Answers1

3

Just to be clear: G means press this key and g means enter this character, so G = Shift+G.

To navigate to a specific line in less, just enter a line number and press G. You don't enter the colon :, e.g. 1+0+0+G to go to line 100.

Entering the same, but pressing Enter instead of G jumps down 100 lines instead. Here are the jumping commands from less --help:

Commands marked with * may be preceded by a number, N.

  g  <  ESC-<       *  Go to first line in file (or line N).
  G  >  ESC->       *  Go to last line in file (or line N).
  p  %              *  Go to beginning of file (or N percent into file).

Here's a list of possible combinations (for a standard US QWERTY keyboard where <=Shift+,, >=Shift+. and %=Shift+5):

  • jump to the first line:
    • G or
    • Shift+, or
    • Esc+Shift+, or
    • P or
    • Shift+5
  • jump to line 8:
    • 8+G or
    • 8+Shift+, or
    • 8+Esc+Shift+, or
    • 8+Shift+G or
    • 8+Shift+. or
    • 8+Esc+Shift+.
  • jump 8 lines down:
    • 8+Enter
  • jump to 8% of the file:
    • 8+P or
    • 8+Shift+5
  • jump to the last line:
    • Shift+G or
    • Shift+. or
    • Esc+Shift+.
dessert
  • 39,982