281

I'm now using Arch Linux, and find a command most works like more and less. To understand the differences between them is a confusing problem. The question Isn't less just more? mentions the differences between less and more. Do you know the differences on color performance, shortcuts and ability moving forward and backward?

9
  • 1
    according to the man page it's pretty much like less but can do multiple windows
    – Bratchley
    Jun 29, 2013 at 12:53
  • 2
    it seems less can't perform color. Run ls | less and I get something unreadable. Jun 29, 2013 at 13:10
  • 12
    @MaxfanZone: Try ls --color=yes | less -R. ls usually disables its text coloring when it's piping to something. less needs -R to pass ANSI escape characters to the screen or -r to pass escape all characters to the screen.
    – user26112
    Jun 29, 2013 at 13:12
  • 2
    @EvanTeitelman: Thanks, that worked, I didn't add -R to less. Jun 29, 2013 at 13:21
  • 26
    most works more or less like more and less - FTFY. Sep 26, 2017 at 7:01

5 Answers 5

342

more

more is an old utility. When the text passed to it is too large to fit on one screen, it pages it. You can scroll down but not up.

Some systems hardlink more to less, providing users with a strange hybrid of the two programs that looks like more and quits at the end of the file like more but has some less features such as backwards scrolling. This is a result of less's more compatibility mode. You can enable this compatibility mode temporarily with LESS_IS_MORE=1 less ....

more passes raw escape sequences by default. Escape sequences tell your terminal which colors to display.

less

less was written by a man who was fed up with more's inability to scroll backwards through a file. He turned less into an open source project and over time, various individuals added new features to it. less is massive now. That's why some small embedded systems have more but not less. For comparison, less's source is over 27000 lines long. more implementations are generally only a little over 2000 lines long.

In order to get less to pass raw escape sequences, you have to pass it the -r flag. You can also tell it to only pass ANSI escape characters by passing it the -R flag.

See less FAQs for more details: http://www.greenwoodsoftware.com/less/faq.html

most

most is supposed to be more than less. It can display multiple files at a time. By default, it truncates long lines instead of wrapping them and provides a left/right scrolling mechanism. most's website has no information about most's features. Its manpage indicates that it is missing at least a few less features such as log-file writing (you can use tee for this though) and external command running.

By default, most uses strange non-vi-like keybindings. man most | grep '\<vi.?\>' doesn't return anything so it may be impossible to put most into a vi-like mode.

most has the ability to decompress gunzip-compressed files before reading. Its status bar has more information than less's.

most passes raw escape sequences by default.

13
  • 74
    My head... all these double-entendres...
    – Wutaz
    Jun 29, 2013 at 17:34
  • 302
    less is more, but more more than more is, so more is less less, so use more less if you want less more. (...) If less is more than more, most is more than less.” —Slackware Linux Essentials Jun 30, 2013 at 20:22
  • 10
    @AlberteRomero That's it, more or less, at least most-ly,. LOL I really like the horizonital scroll in most.
    – Joe
    Jul 5, 2013 at 20:39
  • 6
    I just tried most because it colours man pages nicely, however I don't think it supports regular expression searches. Also, having to mess around with a ~.mostrc file to get vi-like keybindings leaves me wanting less. Sometimes less is more than most :)
    – starfry
    Feb 6, 2017 at 9:02
  • 13
    Just wait til you see notquite
    – vol7ron
    Jun 22, 2017 at 2:04
54

Short answer:

Just use less and forget about more

Longer version:

more is old utility

You can't browse step wise with more, you can use space to browse page wise, or enter line by line, that is about it.

less is more + more additional features

You can browse page wise, line wise both up and down, search

1
  • 1
    If "more" is lacking for you and you know a few vi commands use "less" Aug 9, 2015 at 20:38
19

There is one single application whereby I prefer more to less:

To check my LATEST modified log files (in /var/log/), I use ls -AltF | more.

While less deletes the screen after exiting with q, more leaves those files and directories listed by ls on the screen, sparing me memorizing their names for examination.

(Should anybody know a parameter or configuration enabling less to keep it's text after exiting, that would render this post obsolete.)

2
  • 28
    The parameter you want is -X (long form: --no-init). From less' manpage: Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen. Mar 9, 2016 at 10:18
  • 1
    FWIW, less --version gives me: less 458 (GNU regular expressions) Copyright (C) 1984-2012 Mark Nudelman Mar 9, 2016 at 10:20
11

more, less and most are a terminal pagers or paging programs used to view the contents of text file.

more: more is a very basic,oldest and popular pager. more is originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement. i.e. more can move forwards and backwards in text files but cannot move backwards in pipes.

less: less is a more advanced pager that allows movement forward and backward, and contains extra functions such as search. less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi.

most: less is more than more, most is more than less. Whereas the other pagers can only display one file at a time, most is capable of viewing any number of files,

1
  • 2
    most is more than less only for some features like split screen (and display different files in split), but there is also stuff that only less can do like filter (see my comment below) Oct 19, 2020 at 23:44
11

Summary

more, less and most are three pagers, we can compare them this way:

less is more than more,
most is more than more, approximately,
less and most are different, none is better.

More

  • more is a very basic pager, where you can configure almost nothing.
  • It uses Vim key bindings by default, and you can't change them.
  • Sometimes you have to use more and can't use another pager instead, for example in long output (like :highlight) in vim, you can do set more, but you can't set less or set most instead. Actually, I'm not sure vim uses the true more because some features like search are missing.
  • It supports colors (it can display 256 colors output where most can't).
  • You will quit easily, sometimes by accident, for example if you search a pattern and it isn't found, more is exited (less and most don't behave that way).

Less

  • less is based on more, with extra features.
  • Shortcuts are also Vim-based but they can be changed (they are changed in a strange way with lesskey).
  • Can edit the file with an editor like Vim (it means you can have more in vim in less).
  • There is an environment variable called LESS_IS_MORE to make less behave mostly like more.

Most

  • most isn't an improvement of less or more, it's a different software with a similar but not identical behavior.
  • It's not always installed by default.
  • Can edit file with an editor too.

Most VS Less

Both less and most have features that the other don't have. I sometimes see, like in this website,

If less is more than more, most is more than less.

Or on this post:

most: less is more than more, most is more than less. Whereas the other pagers can only display one file at a time, most is capable of viewing any number of files

Actually, you can load several files on less with a command like less foo bar: it will display the file foo but you can see bar with the command :n.

What Less can do and Most can't

  • regex search, with /. Actually, most's manual says search routines "use regular expressions", but I'm not sure there is a way to use them (the manual does not explain how).
  • Reverse search direction with N. With most, the only way is to do again the last search with ? and then you can move backward only).
  • Filter, with &: display only matching lines. It's a bit like a grep but you keep the same shortcuts you had before.
  • Vim-like marks: you can mark a position in text for every letter. most has only one mark, so you can lose the most mark by accident (overwrite it with another text position).
  • Half-screen scroll. most only has page-up and page-down. If your screen can see 30 lines and you want to see important stuff on line 20 and line 40 at the same time, it can be done with half-screen scroll, but not with only screen scroll. It can look a bit irrelevant but it's not, after reading lots of manpages, I can see the difference (I also mapped a similar feature in Vim instead of "search letter in line" (default is f and t)).
  • Go to matching () {} [] or any match you want to define.
  • There is more information in less's manual than in most's manual (1102+300 lines vs 270 lines, depends on terminal size).
  • less can display (at least) 256 colors, and most can display only 8 colors.
  • less can also display text formatting like bold, blinking etc. with for example \e[5m, and most can't.

What Most can do and Less can't

  • Split screen vertically (can only cut screen in half and can't resize it, can be done several times).
  • Configure it with a single config file.
  • Binary mode, that looks like xxd.
  • With most, you have colors in manual by default. For less, there is a way to do the same but it's not the default behavior. That's probably a reason why some people think less can't do the same. If you still want most to be your manpager, then do export MANPAGER=most.

Not the answer you're looking for? Browse other questions tagged or ask your own question.