So Gilles mentioned in the chat room that:
less '+>' /path/to/file
can be used with less
in order to view a file in reverse. I've never seen it before.
I'm curious – what's going on with the +>
operator in the title? Is this less
specific syntax? Can it be used otherwise? Are there similar operators I should probably know about?
Best Answer
It's
less
specific (you can guess this with the quotes around the operator to avoid the shell interpreting it). The+
argument tellsless
to apply this command after opening the file, in this case>
which is the keystroke for going to the end of the file. You can try this out by opening some (long) file withless
and hitting >.+>
is just a shortcut for this. A fairly more common use-case you'll find in the wild is callingless +## /path/to/file
where##
is a line number you want to be displayed byless
.At least
+##
also works forvi
andemacs
.