User Tools

Site Tools


less

If you want to send us your comments, please do so. Thanks
More on comments


less

Warning: When searching a word occurring only once in a file containing one very long string less will not jump to the result of what is searched for although the word is in the sting

OptionExplanationRemark
hShow a command overview
qQuit less
-eQuit less after the last lineFiles are shonw as if they are one file. Watch the status line. Saves typing “:n”'s. --quit-at-eof
less aptitude.2* | lessShows the contens of all the aptitude.2* files whether they are gziped or not into one view
-rDisplay “raw” control characters--raw-control-chars
-MMore information on the status line. Short promt or long promptWhen less is running “-M” is a toggle for the status line length --LONG-PROMPT
-JStatus column on the leftColumns with search hits are marked. Also used when the -w or -W options: mark the frist not seen line. When less is running “-J” is a toggle for the status column
-NShow line numbersWhen less is running “-N” is a toggle for line numbers. When you scroll through a large file you can stop the calculation of the line numbers with ESC
-SDo not fold linesWhen less is running “-S” is a toggle for line folding
xLEFTARROWSroll horizontally x columnsUse with the “-S” option
xRIGHTARROWSroll horizontally x columnsUse with the “-S” option
-GTurn off highlighting (of searchresults)When less is running “-G” is a toggle for highlighting
-iCase insensitive searching unless the searchstring contains capitalsWhen less is running “-i” is a toggle for case (in)sensitive searching
--tabs=nSet the tab with to nExample --tabs=2
/searchstringSearch forwardNext with “n”. Back with “N”
?searchstringSearch backwardsNext with “n”. Forward with “N”
&searchstringshow only lines containing searchstringBack to the full file with “& ENTER”
ggJump to the first lineSometimes “g” is sufficient, sometimes “gg” is needed
GJump to the end of the file or as far as the file is loaded
g100Jump to line 100When you scroll through a large file, like with “g 1000000” you can start and stop the scrolling with CTRL-S and CTRL-Q
g''Jump back to the previous jump location. (g apostrophe apostrophe)
-WTemporarily highlights the first new line after any sroll down movement, with the keyboard keys, larger than one lineSee also the “-w” command
fScroll donw one page
SPACEScroll donw one page
bScroll up one page
uSroll up half a page
dScroll down half a page
kScroll up one line“K” scroll along until only the first line is visible
jScroll down one line“J” scroll along until only the last line is visible
maMark a position with label “a”. Back to the position: 'a (apostrophe a). Labels: [a-zA-Z]
vOpen file in $EDITOR. After editing returns to less

$LESS variable

Add LESS=“-JMQRSiN”; export LESS to ~/.bashrc and do source ~/.bashrc. The options will be activated everytime less starts. Other options are also possible. See the table above or the man page

Key bindings

  1. Create a file called $HOME/.lesskey with the contents like in lesskey.txt (you can download an rename it)
  2. Save it to $HOME/.lesskey
  3. Run lesskey
  4. Now a binary file $HOME/.less should exist and new key bindings should be active
    1. We added “a” and “;” for next and previous page so we do not need to enter the “:” every time.

Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
less.txt · Last modified: 04-09-2021 15:16 by wim