{"id":51861,"date":"2025-09-29T05:51:44","date_gmt":"2025-09-29T02:51:44","guid":{"rendered":"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/"},"modified":"2025-09-29T05:51:44","modified_gmt":"2025-09-29T02:51:44","slug":"how-to-configure-man-step-by-step","status":"publish","type":"post","link":"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/","title":{"rendered":"How to Configure Man Step by Step"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#Quick_note_before_you_start\" >Quick note before you start<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#What_%E2%80%9Cman%E2%80%9D_does_and_why_configure_it\" >What &#8220;man&#8221; does and why configure it<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#Step-by-step_configuration\" >Step-by-step configuration<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#1_Check_whether_man_is_installed\" >1) Check whether man is installed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#2_Install_man_if_needed\" >2) Install man (if needed)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#3_Build_or_update_the_man_database\" >3) Build or update the man database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#4_Add_and_register_custom_manual_directories\" >4) Add and register custom manual directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#5_Choose_and_configure_the_pager\" >5) Choose and configure the pager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#6_Improve_appearance_and_color\" >6) Improve appearance and color<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#7_Control_formatting_options\" >7) Control formatting options<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#8_Localization_and_language\" >8) Localization and language<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#9_Troubleshooting_common_issues\" >9) Troubleshooting common issues<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#Quick_example_get_a_clean_setup_on_DebianUbuntu\" >Quick example: get a clean setup on Debian\/Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-man-step-by-step\/#Final_summary\" >Final summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Quick_note_before_you_start\"><\/span>Quick note before you start<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>If you mean the Unix\/<a href=\"https:\/\/www.hostinger.com\/tutorials\/linux-commands\" target=\"_blank\" rel=\"noopener\">linux<\/a> &#8220;man&#8221; manual viewer, this guide walks you through installing, configuring, and troubleshooting it so man pages display the way you want. The steps cover common Linux distributions and <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-2fa-step-by-step\/\">a<\/a> few useful environment variables and tips.<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_%E2%80%9Cman%E2%80%9D_does_and_why_configure_it\"><\/span>What &#8220;man&#8221; does and why configure it<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>The man command displays system manual pages for programs, libraries and system calls. Configuring it helps you:<\/p>\n<p><\/p>\n<ul><\/p>\n<li>See manuals in the pager you prefer (less, more, etc.).<\/li>\n<p><\/p>\n<li>Add custom manual directories so third-party tools show up.<\/li>\n<p><\/p>\n<li>Keep the man database current for fast searches (what\/apropos).<\/li>\n<p><\/p>\n<li>Improve readability with color and wrapping options.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-by-step_configuration\"><\/span>Step-by-step configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Check_whether_man_is_installed\"><\/span>1) Check whether man is installed<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Run a simple check first:<\/p>\n<p><\/p>\n<pre><code>man --version || man --help || man ls<\/code><\/pre>\n<p><\/p>\n<p>If you see version\/help output or the manual for a command, man is present. If the command is missing, install it next.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Install_man_if_needed\"><\/span>2) Install man (if needed)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>On most Linux systems use the package manager:<\/p>\n<p><\/p>\n<ul><\/p>\n<li>Debian\/<a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ubuntu\" target=\"_blank\" rel=\"noopener\">ubuntu<\/a>:\n<pre><code><a href=\"https:\/\/hostadvice.com\/how-to\/web-hosting\/ubuntu\/how-to-use-the-apt-command-to-manage-ubuntu-packages\/\" target=\"_blank\" rel=\"noopener\">sudo apt update<\/a><br \/>\n<a href=\"https:\/\/www.hostinger.com\/tutorials\/sudo-and-the-sudoers-file\/\" target=\"_blank\" rel=\"noopener\">sudo<\/a> apt install man-db manpages manpages-dev<\/code><\/pre>\n<p>\n  <\/li>\n<p><\/p>\n<li>Fedora\/RHEL\/<a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-centos\" target=\"_blank\" rel=\"noopener\">centos<\/a>:\n<pre><code>sudo dnf install man-db man-pages<br \/>\n# or on older systems:<br \/>\nsudo yum install man-db man-pages<\/code><\/pre>\n<p>\n  <\/li>\n<p><\/p>\n<li>Arch Linux:\n<pre><code>sudo pacman -S man-db man-pages<\/code><\/pre>\n<p>\n  <\/li>\n<p><\/p>\n<li>macOS typically includes man by default.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Build_or_update_the_man_database\"><\/span>3) Build or update the man database<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Many distributions use mandb to index manual pages. Run it after installing new packages or adding manual files:<\/p>\n<p><\/p>\n<pre><code>sudo mandb<\/code><\/pre>\n<p><\/p>\n<p>If your distro lacks mandb, look for makewhatis or whatis -u (older systems).<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Add_and_register_custom_manual_directories\"><\/span>4) Add and <a href=\"https:\/\/infinitydomainhosting.com\/register.php\">register<\/a> custom manual directories<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>When you install software locally, place man files in the standard layout and update the database:<\/p>\n<p><\/p>\n<pre><code># example: install a local man page<br \/>\nsudo install -m 644 mytool.1 \/usr\/local\/share\/man\/man1\/<br \/>\nsudo mandb<\/code><\/pre>\n<p><\/p>\n<p>Avoid overwriting MANPATH environment variable unless you need to. When necessary, add directories in these ways:<\/p>\n<p><\/p>\n<ul><\/p>\n<li>System-wide: edit \/etc\/manpath.config (or a distro-specific manpath file) to include additional paths.<\/li>\n<p><\/p>\n<li>User-specific: add a path to MANPATH in your shell rc:\n<pre><code>export MANPATH=\"\/usr\/local\/share\/man:\/usr\/share\/man:${MANPATH:-}\"<\/code><\/pre>\n<p>\n    Note: setting MANPATH manually can disable automatic path discovery; prefer adding files under \/usr\/local\/share\/man if possible.\n  <\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Choose_and_configure_the_pager\"><\/span>5) Choose and configure the pager<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>man by default uses the pager from PAGER or MANPAGER. A common, friendly choice is less with raw control character support:<\/p>\n<p><\/p>\n<pre><code>export MANPAGER=\"less -R\"<br \/>\nexport PAGER=\"less -R\"<\/code><\/pre>\n<p><\/p>\n<p>Add these lines to ~\/.bashrc or ~\/.profile. You can also invoke man with a pager for a single command:<\/p>\n<p><\/p>\n<pre><code>man -P \"less -R\" tar<\/code><\/pre>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Improve_appearance_and_color\"><\/span>6) Improve appearance and color<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>To keep bold and underlined text visible when using less, set terminal escape sequences. Put these in your shell rc file:<\/p>\n<p><!--KB_CAT_BLOCK--><\/p>\n<figure class=\"kb-cat-placeholder\" style=\"margin:1.75rem 0;display:block;\">\n<div class=\"kb-cat-wrap\" style=\"position:relative; overflow:hidden; border-radius:12px; box-shadow:0 10px 36px rgba(0,0,0,0.14);\"><img src=\"https:\/\/infinitydomainhosting.com\/kb\/assets\/img\/cat-default.webp\" alt=\"How to Configure Man Step by Step\" loading=\"lazy\" decoding=\"async\" style=\"max-width:100%;height:auto;display:block;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,0.12);\" \/><\/p>\n<div class=\"kb-cat-gradient\" style=\"position:absolute; inset:0; background:linear-gradient(180deg, rgba(9,23,60,0.66) 0%, rgba(11,30,70,0.45) 40%, rgba(11,30,70,0.15) 100%);\"><\/div>\n<div class=\"kb-cat-textbox\" style=\"position:absolute; inset:auto 5% 7% 5%; color:#fff; text-align:center; display:flex; flex-direction:column; gap:.4rem; align-items:center; justify-content:flex-end;\">\n<div class=\"kb-cat-title\" style=\"font-weight:800; font-size:clamp(20px,3.6vw,34px); line-height:1.2; letter-spacing:.2px; text-shadow:0 1px 2px rgba(0,0,0,.35);\">How to Configure Man Step by Step<\/div>\n<div class=\"kb-cat-meta\" style=\"opacity:1; font-weight:600; font-size:clamp(13px,2.6vw,16px); line-height:1.45; text-shadow:0 1px 2px rgba(0,0,0,.28);\">Quick note before you start If you mean the Unix\/linux &quot;man&quot; manual viewer, this guide walks you through installing, configuring, and troubleshooting it so man pages display the way you\u2026<\/div>\n<div class=\"kb-cat-desc\" style=\"opacity:1; font-weight:500; font-size:clamp(12px,2.4vw,15px); line-height:1.5; max-width:900px; text-wrap:balance; text-shadow:0 1px 2px rgba(0,0,0,.25);\">Databases<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p><\/p>\n<pre><code>export LESS_TERMCAP_mb=$'e[1;31m'   # begin blink\/bold<br \/>\nexport LESS_TERMCAP_md=$'e[1;31m'   # begin bold<br \/>\nexport LESS_TERMCAP_me=$'e[0m'      # end mode<br \/>\nexport LESS_TERMCAP_se=$'e[0m'<br \/>\nexport LESS_TERMCAP_so=$'e[1;44;33m'<br \/>\nexport LESS_TERMCAP_ue=$'e[0m'<br \/>\nexport LESS_TERMCAP_us=$'e[1;32m'<\/code><\/pre>\n<p><\/p>\n<p>These environment variables make headings, bold and underlines stand out. Keep MANPAGER=&#8221;less -R&#8221; so color control sequences pass through.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_Control_formatting_options\"><\/span>7) Control formatting options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>To adjust how man calls the typesetter you can use MANROFFOPT and MANWIDTH. For example:<\/p>\n<p><\/p>\n<pre><code>export MANROFFOPT=\"-c\"      # preserve hyphenation\/formatting in some setups<br \/>\nexport MANWIDTH=80<\/code><\/pre>\n<p><\/p>\n<p>Behavior varies between implementations, so try options on a sample page. Alternatively use man flags like -T and pass groff options directly when necessary.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_Localization_and_language\"><\/span>8) Localization and language<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>man shows pages in the language set by your locales. Example:<\/p>\n<p><\/p>\n<pre><code>export LANG=fr_FR.UTF-8<br \/>\n# or<br \/>\nexport LC_MESSAGES=en_US.UTF-8<\/code><\/pre>\n<p><\/p>\n<p>Change these to see manuals in the desired language if translated pages exist.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_Troubleshooting_common_issues\"><\/span>9) Troubleshooting common issues<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>No manual for a command: confirm package with man pages is installed; run sudo mandb; check MANPATH.<\/li>\n<p><\/p>\n<li>Poor formatting or weird characters: ensure MANPAGER uses less -R and your terminal supports UTF-8; check MANWIDTH or MANROFFOPT.<\/li>\n<p><\/p>\n<li>Custom man pages not found: place them in the correct manX directory (man1, man8, etc.), run sudo mandb, and check permissions (world-readable).<\/li>\n<p><\/p>\n<li>Accidental MANPATH override: remove MANPATH from your shell rc and rely on system config or add only the extra path with care.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Quick_example_get_a_clean_setup_on_DebianUbuntu\"><\/span>Quick example: get a clean setup on Debian\/Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<pre><code># install man tools<br \/>\nsudo apt update<br \/>\nsudo apt install man-db manpages<br># set a pleasant pager and colors in ~\/.bashrc<br \/>\necho 'export MANPAGER=\"less -R\"' >> ~\/.bashrc<br \/>\necho 'export PAGER=\"less -R\"' >> ~\/.bashrc<br \/>\n# (add LESS_TERMCAP_* lines from above to ~\/.bashrc as desired)<br># add a local man page and refresh the index<br \/>\nsudo install -m 644 mytool.1 \/usr\/local\/share\/man\/man1\/<br \/>\nsudo mandb<\/code><\/pre>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Final_summary\"><\/span>Final summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>Configuring man is mostly about making sure the program and its index are installed, adding any custom manual directories in the right place, and setting environment variables for the pager, colors, and locale. Use sudo mandb after adding pages, prefer \/usr\/local\/share\/man for local installs, and set MANPAGER=&#8221;less -R&#8221; and a few LESS_TERMCAP_* variables to improve readability. If something doesn&#8217;t show up, check MANPATH, file permissions and rerun the man database update.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick note before you start If you mean the Unix\/linux &#8220;man&#8221; manual viewer, this guide walks you through installing, configuring, and troubleshooting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":51862,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[4594,4593,1,3,5,11,7,88],"tags":[811,515,670,706,12565,10765,12199,12566,719,525,406],"class_list":["post-51861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-networking","category-databases","category-general","category-php-scripts","category-seo","category-support","category-web-design","category-web-hosting","tag-configuration","tag-configure","tag-guide","tag-how-to","tag-how-to-configure-man-step-by-step","tag-instructions","tag-man","tag-manual","tag-setup","tag-step-by-step","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/comments?post=51861"}],"version-history":[{"count":1,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51861\/revisions"}],"predecessor-version":[{"id":51863,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51861\/revisions\/51863"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media\/51862"}],"wp:attachment":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media?parent=51861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/categories?post=51861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/tags?post=51861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}