What are the differences between most, more and less?

216,576

Solution 1

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

Solution 2

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.)

Solution 3

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,

Solution 4

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.
Share:
216,576

Related videos on Youtube

Chongxu Ren
Author by

Chongxu Ren

I'm an undergraduate in Tsinghua University, major in Computer Science.

Updated on September 18, 2022

Comments

  • Chongxu Ren
    Chongxu Ren almost 2 years

    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?

    • Admin
      Admin almost 11 years
      according to the man page it's pretty much like less but can do multiple windows
    • Admin
      Admin almost 11 years
      it seems less can't perform color. Run ls | less and I get something unreadable.
    • Admin
      Admin almost 11 years
      @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.
    • Admin
      Admin almost 11 years
      @EvanTeitelman: Thanks, that worked, I didn't add -R to less.
    • Admin
      Admin almost 7 years
      most works more or less like more and less - FTFY.
    • Admin
      Admin about 6 years
      TL;DR use less because more is useless.
  • Admin
    Admin almost 11 years
    My head... all these double-entendres...
  • Admin
    Admin almost 11 years
    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
  • Admin
    Admin almost 11 years
    @AlberteRomero LOL
  • Admin
    Admin almost 11 years
    @AlberteRomero That's it, more or less, at least most-ly,. LOL I really like the horizonital scroll in most.
  • Jonathan.Brink
    Jonathan.Brink almost 9 years
    If "more" is lacking for you and you know a few vi commands use "less"
  • Jan Warchoł
    Jan Warchoł over 8 years
    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.
  • Admin
    Admin over 8 years
  • Admin
    Admin over 7 years
    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 :)
  • Admin
    Admin about 7 years
    Just wait til you see notquite
  • Admin
    Admin over 5 years
    @J.A.Corbal Fantastic. I was reading this in public and could not stop laughing. No one around me would get it. So I just kept laughing more.
  • Admin
    Admin about 5 years
    @J.A.Corbal this makes a lot more sense thanks to your code highlighting
  • Admin
    Admin about 4 years
    re: "most has the ability to decompress gunzip-compressed files before reading" -- you can just use zless or ...|gunzip|less
  • ewen-goisot
    ewen-goisot over 3 years
    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)
  • Admin
    Admin over 3 years
    @vol7ron notquite was an interesting project but since has been obsoleted by the ultimately perfected implementation none.
  • Admin
    Admin over 3 years
    @startfry most's manual speaks about regular expressions but what they say isn't clear at all and I never found a way to use them in most. And if you like colors, there is a way to do the same with less.
  • Admin
    Admin about 3 years
    Waiting for least, which will be more than most.