- Kali Linux Tutorial
- Kali Linux - Home
- Installation & Configuration
- Information Gathering Tools
- Vulnerability Analyses Tools
- Kali Linux - Wireless Attacks
- Website Penetration Testing
- Kali Linux - Exploitation Tools
- Kali Linux - Forensics Tools
- Kali Linux - Social Engineering
- Kali Linux - Stressing Tools
- Kali Linux - Sniffing & Spoofing
- Kali Linux - Password Cracking Tools
- Kali Linux - Maintaining Access
- Kali Linux - Reverse Engineering
- Kali Linux - Reporting Tools
- Kali Linux Useful Resources
- Kali Linux - Quick Guide
- Kali Linux - Useful Resources
- Kali Linux - Discussion
How to View Colored Man Pages in Linux?
The man pages are important reference pages for any Unix user. But their look and feel is very boring because it is just lines of text with some punctuations. In this article we will see how the different parts of the man pages can be coloured and highlighted. That will make it very easy to follow the instructions in the man pages.
The most command can be used to display the colour man pages but first we have to install it and then add to our bash profile so that it becomes available in the environment. The below command shows how to install most.
sudo apt install most
Once added we, can append the value into the .bashrc file, so that the profile gets updated and the variable is available in the environment. We refresh the profile using the source command.
export PAGER="most" # Sourve the .profile file. $ source ~/.profile
Next we run the below command to see how coloured man pages appear when we query the man pages with some command.
Running the above code gives us the following result −
CP(1) User Commands CP(1) NAME cp - copy files and directories SYNOPSIS cp [OPTION]... [-T] SOURCE DEST cp [OPTION]... SOURCE... DIRECTORY cp [OPTION]... -t DIRECTORY SOURCE... DESCRIPTION Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. -a, --archive same as -dR --preserve=all --attributes-only don't copy the file data, just the attributes --backup[=CONTROL]
using the TERMCAP variable
Termcap stands for terminal capability database. Located in /etc/termcap, it is an ASCII file that lists the capabilities of many different types of terminals.Programs can read termcap to find the particular escape codes needed to control the visual attributes of the terminal actually in use. We add the below code to .bashrc file.
export LESS_TERMCAP_mb=$'\e[1;32m' export LESS_TERMCAP_md=$'\e[1;32m' export LESS_TERMCAP_me=$'\e[0m' export LESS_TERMCAP_se=$'\e[0m' export LESS_TERMCAP_so=$'\e[01;33m' export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_us=$'\e[1;4;31m'
next we runt the ls command and get the coloured output as below.
- Related Articles
- How to output colored text to a Linux terminal?
- Linux man Command
- How do you determine which individual pages are resident on Linux
- 4 Ways to View Disks and Partitions in Linux
- How can we use hub pages to find authoritative pages?
- How to include CSS in HTML Pages
- How to create colored Venn Diagrams?
- How to link pages using absolute URL in HTML?
- How to link pages using relative URL in HTML?
- How to Address Mapping using Pages in Computer Architecture?
- How to turn wikipedia pages into ebooks
- How to author fast-loading HTML pages?
- How to allow to go next internal pages in android webview?