What does `LESS=+/EXAMPLE\:` mean?
Solution 1:
It doesn't mean anything in bash. It's some arbitrary text that gets stored in the $LESS environment variable for that single command.
But when you run less
, it reads the contents of $LESS and interprets them much like command-line arguments. Usually this is where you'd store configuration for it.
(less is not a preprocessor: it's a simple text file viewer, aka a pager. Note that man
has no built-in reader: it just generates the text via groff (the actual preprocessor), then always runs either less or some other pager to scroll through it. The authors of that tutorial assume your system will be using less because it's so ubiquitous.)
When less encounters arguments starting with a +
, the remainder is further interpreted as commands or keypresses to simulate: e.g. if it were +G
then less would pretend you had pressed G after opening the file, and would scroll down.
In your case, less pretends you had typed /EXAMPLE:
after opening the file. / is the search key/command in less, and the rest is the text to search for.
The result is that the command opens the manpage of "parallel", then scrolls down to the section titled "EXAMPLE".
Solution 2:
As grawity's excellent answer indicates, it's a way of giving an instruction to the less
pager. In this specific case, using the manual and tutorial of GNU Parallel, it makes reading the examples easy.
As you can see from even the table of contents in the online manual, each example starts with the string EXAMPLE:
, so the command LESS=+/EXAMPLE: man parallel
lets you jump to the fist example, and subsequent examples by pressing n (for next match).
For example:
(each jump in manual section is a n keypress)