Skip to content

Latest commit

 

History

History
57 lines (47 loc) · 1.04 KB

less.md

File metadata and controls

57 lines (47 loc) · 1.04 KB

Less Cheatsheet

General

Command Function
q Quit
R Refresh
= or Ctrl-g Show filename & position

Navigation

Command Function
g Top
G Bottom
f, space or PgDn Forward one page
b or PgUp Back one page
d Forward ½ a page
u Back ½ a page
j Forward 1 line
k Back one page
%n Go to n percent of the file
(, { or [ Go to matching bracket
:n Next file (when invoked with multiple or globbed files)
:p Previous file

Search

Command Function
/foo Search for foo
?foo Search backwards
n Next match
N Previous match
/!foo Find lines not matching foo
/*foo Find foo in all files

Misc

Command Function
q Quit
%foo Filter - show only lines containing foo
F Follow mode
-S Wrap on/off
h Help

Command line options

Option Function
-pfoo Search for foo
+F Follow
+G Go to bottom of file
''' + trick works with any command
-r Raw control characters - might be colourful! (Or might break.)