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
Option | Explanation | Remark |
---|---|---|
h | Show a command overview | |
q | Quit less | |
-e | Quit less after the last line | Files are shonw as if they are one file. Watch the status line. Saves typing “:n”'s. --quit-at-eof |
less aptitude.2* | less | Shows the contens of all the aptitude.2* files whether they are gziped or not into one view | |
-r | Display “raw” control characters | --raw-control-chars |
-M | More information on the status line. Short promt or long prompt | When less is running “-M” is a toggle for the status line length --LONG-PROMPT |
-J | Status column on the left | Columns 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 |
-N | Show line numbers | When 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 |
-S | Do not fold lines | When less is running “-S” is a toggle for line folding |
xLEFTARROW | Sroll horizontally x columns | Use with the “-S” option |
xRIGHTARROW | Sroll horizontally x columns | Use with the “-S” option |
-G | Turn off highlighting (of searchresults) | When less is running “-G” is a toggle for highlighting |
-i | Case insensitive searching unless the searchstring contains capitals | When less is running “-i” is a toggle for case (in)sensitive searching |
--tabs=n | Set the tab with to n | Example --tabs=2 |
/searchstring | Search forward | Next with “n”. Back with “N” |
?searchstring | Search backwards | Next with “n”. Forward with “N” |
&searchstring | show only lines containing searchstring | Back to the full file with “& ENTER” |
gg | Jump to the first line | Sometimes “g” is sufficient, sometimes “gg” is needed |
G | Jump to the end of the file or as far as the file is loaded | |
g100 | Jump to line 100 | When 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) | |
-W | Temporarily highlights the first new line after any sroll down movement, with the keyboard keys, larger than one line | See also the “-w” command |
f | Scroll donw one page | |
SPACE | Scroll donw one page | |
b | Scroll up one page | |
u | Sroll up half a page | |
d | Scroll down half a page | |
k | Scroll up one line | “K” scroll along until only the first line is visible |
j | Scroll down one line | “J” scroll along until only the last line is visible |
ma | Mark a position with label “a”. Back to the position: 'a (apostrophe a). Labels: [a-zA-Z] | |
v | Open 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
- Create a file called $HOME/.lesskey with the contents like in lesskey.txt (you can download an rename it)
- Save it to $HOME/.lesskey
- Run lesskey
- Now a binary file $HOME/.less should exist and new key bindings should be active
- 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.
less.txt · Last modified: 04-09-2021 15:16 by wim