Page viewers: more, less, and most

Forum Forums General Tips and Tricks Page viewers: more, less, and most

  • This topic has 5 replies, 3 voices, and was last updated Dec 16-12:56 am by Brian Masinick.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #47503
    Moderator
    Brian Masinick

      https://unix.stackexchange.com/questions/81129/what-are-the-differences-between-most-more-and-less is an article comparing three of the available text file pagers. I guess that the vast majority of people are only aware of more – if they are aware of ANY file pagers at all, but the truth is that all three of these file pagers have been available for over twenty years. More is the original file pager and it predates Linux distributions because it was available long ago when UNIX was a prevalent operating system. The more program, which was initially released in 1978. Most is not mentioned very often; the link above compares it to more and less.

      Necessity being the mother of invention, it was the inability of early versions of more to scroll backward through a file that prompted Mark Nudelman to develop less and to overcome that specific problem. That work started in 1983, and the first version was released outside of the company he worked for in 1985. As of October 2019, he is still the maintainer of less.

      Source of information about more and less: https://www.howtogeek.com/444233/how-to-use-the-less-command-on-linux/

      --
      Brian Masinick

      #47509
      Anonymous
        Helpful
        Up
        0
        ::

        You posted this today is a wild coincidence. Last night I had intended to post to the “improvements for future versions” topic, to suggest adding a colorizer function in the stock .bashrc

        I had refrained from posting because I was (still am) unsure which colors to suggest as default.

        ### color assignements for markup within MANpages
        ###
        ### this page explains, and lists available colorcodes for foreground and background
        ### https://askubuntu.com/questions/558280/changing-colour-of-text-and-background-of-terminal
        ###
        ###    30=dkgray 31=red  32=limegreen  33=yellow  34=lightblue 35=purp  36=teal  37=white
        man() {
        env \
        LESS_TERMCAP_mb=$(printf "\e[1;35m") \
        LESS_TERMCAP_md=$(printf "\e[1;34m") \
        LESS_TERMCAP_me=$(printf "\e[0m") \
        LESS_TERMCAP_se=$(printf "\e[0m") \
        LESS_TERMCAP_so=$(printf "\e[103;30m") \
        LESS_TERMCAP_ue=$(printf "\e[0m") \
        LESS_TERMCAP_us=$(printf "\e[1;31m") \
        man "$@"
        }
        export MANPAGER='less -s -M +Gg'

        .

        #47514
        Member
        Xecure
          Helpful
          Up
          0
          ::

          Last night I had intended to post to the “improvements for future versions” topic, to suggest adding a colorizer function in the stock .bashrc

          You mean something like the color schemes (dracula, nord, etc.)? It would be good. But I think we should use colors close to the intended colors and not mix colors that mean different things.
          Also, I have seen that the cli-aptiX on a light-background terminal is unreadable (xterm by default is white). Could this improve if the terminal colors also change or are those colors hard-coded?

          guess that the vast majority of people are only aware of more – if they are aware of ANY file pagers at all

          I use less, instead of more, but yes, it is very useful for reading large outputs of text inside the console.

          antiX Live system enthusiast.
          General Live Boot Parameters for antiX.

          #47515
          Moderator
          Brian Masinick
            Helpful
            Up
            0
            ::

            The colorize tool may be more reliable than using something else, based on my quick reading of the references.

            In any case there are choices available to modify the paging appearance and there are also multiple paging programs with different use cases.

            I used to use all three of them when developing or maintaining software. These days I simply use more. If I want to take an in depth look I use an editor.

            --
            Brian Masinick

            #47518
            Anonymous
              Helpful
              Up
              0
              ::

              To be clear, that bash function I posted serves as a wrapper, an alias, for the “man” command.
              It does not affect the overall terminal session.

              BitJam posted a great explanation of terminal colors HowTo here in the forum a few years back.
              I can’t recall whether it was specific to urxvtmnopq

              roxterm –color-scheme=SCHEME
              see: /usr/share/roxterm/Config/Colours/*
              I agree that the status quo default white bg is unappealing.

              related:
              /usr/local/bin/fancy-prompts.bash
              /usr/local/bin/fancy-prompts.zsh
              ~/.config/fancy-prompts-bash.conf

              #47520
              Moderator
              Brian Masinick
                Helpful
                Up
                0
                ::

                Regarding color scheme with roxterm, it’s actually pretty easy and there is a GUI you can use. It appears to retain the state; I’ve been using the setup for quite a while.

                Here are the particulars:

                1. In the top roxterm menu, select Preferences, then Edit Current Colour Scheme
                2. Click the check box to Set Text and Background Colours
                3. Click on the rectangles to select the desired Foreground and Background colours; actually, the Foreground states “Text Colour”.
                4. You can also select the desired cursor colour and whether you want Bold and Dim colours set too.

                In case it is not obvious, click on the rectangle next to the section you want to change.
                You can actually type in common color (colour) names and they will automatically convert to a hexidecimal number (0-9, A-F) or you can manually examine colors using the “triangle”, and third, you can type in the hexidecimal color if you are a true geek and know them – I know the base colors:
                255 Red 0 Green 0 Blue creates a red color
                0 Red 255 Green 0 Blue creates a green color
                0 Red 0 Green 255 Blue creates a blue color
                238 Red 180 Green 34 Blue creates a Goldenrod2 color

                Experiment and find your favorite text and background (English colour) or American color.

                These tools are neat for changing the command prompt in a terminal:
                /usr/local/bin/fancy-prompts.bash
                /usr/local/bin/fancy-prompts.zsh
                … and the location of the bash configuration:
                ~/.config/fancy-prompts-bash.conf

                • This reply was modified 2 years, 4 months ago by Brian Masinick.

                --
                Brian Masinick

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.