--- layout: page category_title: Basic commands category-page: basic tags: More and less author: Marzio Lunghi title: More and Less ---
Both commands show the content of one or more files and it’s possible to do a research with particular flags, but the “less” one allows us to go also backwards while reading the text of a file.
More is quite old, less is more recent and powerful.
General syntax for both is:
Device-name:Current-position username$ less [flags] path/name-file.*Less provides some useful commands to navigate and modify the file content. Commands does not include flags, which are included under Options.
Device-name:Current-position username$ more [flags] path/name-file.*
Such commands must be used once the file has been displayed. They are not flags. For a single operation there can be multiple commands.
ENTER RETURN e ^E j ^N CR
Scroll forward N lines, 1 by default, if N is not specified.
y ^Y k ^K ^P
Scroll backward N lines , 1 by default , if N is not specified.
f ^F ^V SPACE
Scroll forward N lines, a window by default, if N is not specified.
b ^B ESC-v
Scroll backward N lines, one window by default, if N is not specified.
ESC-SPACE
Scroll forward one window like SPACE , but don't stop at end-of-file.
d ^D
Scroll forward N lines, by default N correspond to half of the screen size.
u ^U
Scroll Backward N lines, by default N correspond to half of the screen size.
ESC-) RightArrow
Scroll horizontally right N characters, by default half of the screen size, if N is not specified.
ESC-( LeftArrow
Scroll horizontally left N characters, by default half of the screen size, if N is not specified.
Such commands must be used once the file has been displayed. They are not. For a single operation there can be multiple commands.
g < ESC-<
Go to line N, by default 1, if N is not specified.
G > ESC->
Go to line N, by default the last one , if N is not specified.
t
Go to the (N-th) next tag.
T
Go to the (N-th) previous tag.
Options may be given in one of two forms: either a single character preceded by a "-", or a name preceded by "--" .
? OR --help
Display help guide with the description of commands and more , it is sufficient to enter less -? .
-c OR --clear-screen
Repaint by clearing rather than scrolling.
-e -E OR --quit-at-eof --QUIT-AT-EOF
Quit the file, when you scroll to the end of the file.
-~ OR --tilde
Do not display tildes after end of file.