I want to go to line 100 directly when opening a file, but I use -M and +Gg at the same time to show verbose detail in status bar.

  • -M is for the file name and line number of the current screen
  • +Gg will give you the information of the whole line number of the current file and the percentage of the current screen.

So, I want to use:

less -M +Gg +100 file

to go to line 100 and keep all the info in the status bar I want, but the +100 is not working.

I know +Gg means that go to the end of the file and then go to the beginning , but I really like to keep the info +Gg provide in the status line.

So, any advice?

  • less -M +100 file is giving file lines 100-129/3519 4% here. What more gives +Gg? – FloHimself Apr 25 '15 at 20:06
  • @FloHimself less -M +100 file won't give /3519 4% unless you reach the end of the file, +Gg give you that from the start. – CodyChan Apr 25 '15 at 20:12
  • Here it gives that info with just -M +100 right from the start... – FloHimself Apr 25 '15 at 20:15
  • NOTICE: Crossposted to superuser.com/questions/906131/… -- VERY BAD – mdpc Apr 25 '15 at 20:40
  • @FloHimself Not for me, did you make a alias or configuration in your .bashrc? BTW, less v471, Fedora 21 – CodyChan Apr 25 '15 at 20:43

less -M +G100g

The manual +<linenumber> is a special case for +<linenumber>g (probably does not work in all contexts).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.