Unix/Linux-Terminal simulator color man page)

Source: Internet
Author: User

0 install software
The software to be installed is the most page processing program, and the name is pretty cool, and less. My installation environment is gentoo linux. The Code is as follows:

Emerge-v most

1 Software Configuration
After the installation, you can export the environment variables directly. The Code is as follows:

Export PAGER = "/usr/bin/most-s"

In this case, you can see the color page after running man, but there are two problems: first, this configuration is only valid for the current terminal, second, the Operation habits will change (for example, the j command will change when turning down the page), because after all, the most operation method is different from less, unless you are used to the new method, otherwise, it is best to configure it. The configuration is simple. Set the environment variables and configure the operation method.

1.1 configure Environment Variables
To make the configuration available to all users, You need to modify the global environment variables. We recommend that you use this method because common users usually log on, And you often need to switch to the root user for some work, we recommend that you do this to avoid repeated configurations. To do this, you need to modify the/etc/profile or/etc/environment file and add or modify the following content:

PAGER = "/usr/bin/most-s"

If it is only for a specific user, you only need to modify ~ /. Bashrc file.

1.2 configure most to simulate the less operation habits. The configuration file can be configured for all users in the system. We also recommend that you use this method. The configuration file name is/etc/mostrc, modify the most template to generate the most configuration file. Run the following command:

Bzcat/usr/share/doc/most-5.0.0a/lesskeys.rc.bz2>/etc/mostrc # generate a global configuration file

These are not enough. When starting most, the system must know to load the configuration file and set it by setting the environment variable. In the/etc/environment or/etc/profile file, add the following content:

  1. # Most init file
  2. MOST_INITFILE = '/etc/mostrc'

In this way, the next Startup will take effect, and it will be available to users.

1.3 configure most to simulate the less operation habits. The configuration file needs to be configured for a specific user (in fact, you can consider skipping the following content). The configuration file name is :~ /. Mostrc. Modify the most template to generate the most configuration file. Run the following command:

Bzcat/usr/share/doc/most-5.0.0a/lesskeys.rc.bz2> ~ /. Mostrc # generate the configuration file

You can edit the configuration file according to your needs. I only modified one background color configuration to keep the remaining settings unchanged. My configuration file sample is as follows:

  1. % Color settings
  2. % Color normal lightgray black % color setting commented out
  3. Color status yellow blue
  4. Color underline brightgreen black
  5. Color overstrike brightred black

2. Run the test

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.