"word to your moms, I came to drop bombs, I've got more less tips than the Bible's got Psalms." In a recent discussion on Reddit I shared a number of tips about the common utility less(1) that others found helpful so I figured I'd aggregate some of those tips here. Operating on multiple files While most folks invoke less at the tail of a pipeline like $ command | less Invoking less in a pipeline you can directly provide one or more files to open $ less README.txt file.c *.md Invoking less directly Adding files after starting When reading a document, sometimes you want to view another file, adding it to the file list. Perhaps while reading some C source code you want to also look over the corresponding header-file. You can add that header-file to the argument list with :e file.h Navigating multiple files You can navigate between multiple files using :n to go to the next file in the argument-list, and :p for the previous file. You can also use :x to rewind to the first file in the argument-list similar to how :rewind behaves in vi/vim. Removing files after starting While I rarely feel the need to, if you have finished with a file and want to keep your argument list clean, you can use :d to delete the current file from the argument-list. Navigating Jumping to a particular line-number Use «count»G to jump to a particular line-number. So using 3141G will jump to line 3141. It helps to display line numbers. Jumping to a particular percentage-offset Similarly, using «count»% jumps to that percentage-offset of the file. So if you want to go to ¾ of the way through the file, you can type 75% to jump right there. Searching While many folks know you can search forward with /«pattern» and some people know you can use ?«pattern» to search backwards, or use n/N to search again for the next/previous match, less provides modifiers you can specify before the pattern to modify its behavior: ! Find the next line that doesn't match the pattern * search across multiple files, starting f...
First seen: 2026-01-02 15:15
Last seen: 2026-01-03 11:17