Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

Viewing “man” Pages in a Web Browser

Submitted by on September 16, 2011 – 12:43 am 4 Comments

The Unix “man” pages are an indispensable resource even for the most experienced of sysadmins. Unfortunately, in a terminal window the text may be hard to read and getting a hard copy to take with you down to the datacenter will really test your Unix skills. The following quick script will convert the “man” page of your choice into formatted text and open it in the Web browser.

To use this script, save it in a common binary location, such as /usr/local/bin/gman, and make it executable: chmod 755 /usr/local/bin/gman

#!/bin/bash
# www.krazyworks.com
# The script will display man page in Web browser

trap ctrl_c INT

manpage="${1}"

configure() {
        # your UID
        uid=$(id | awk -F'=' '{print $2}' | awk -F'(' '{print $1}')

        # Web browser executable
        wbrowser="/usr/bin/firefox"

        # file for storing PID of the Web browser
        pid="/tmp/gman_browser${uid}.pid"

        # temporary file for storing HTML version of man page
        gmantemp="/tmp/gman_temp_${uid}_${manpage}"
}

cleanup() {
        # cleanup old files
        for i in "${pid}" "${gmantemp}"
        do
                if [ -f "${i}" ]
                then
                        /bin/rm -f "${i}"
                fi
        done
}

function gman {
        man "${manpage}" | col -b > "${gmantemp}"
        /usr/bin/firefox "${gmantemp}"
}

function ctrl_c() {
        cleanup
        exit 1
}

configure
cleanup
gman
cleanup
Print Friendly, PDF & Email

4 Comments »

  • Jose B says:

    I have my CDA. I have many years of experience with young children. In the near future I would like to open a daycare. I would like to hopefully get some helpfull hints on running the business side, so I can become better prepared. What are some things that you wish were told to you before you opened a daycare to help you become better prepared? Any other suggestions would be appreciated.

  • tefa_96 says:

    Earth, air, fire and water, viewed as sacred and indispensable, can be seen as an approach to also living in ways that show virtue and respect to those elements. How do neopagans view and react to living in culture forms that are categorically environmentally unsustainable? Do many have views against centralized government and excessively interdependent infrastructures? Can infrastructures such as these be seen as a form of an alienation from having an engaged, direct and immanent relationship with those resources. Are there neopagan arguments for autonomous and self sustained forms of community?

  • Andre says:

    I can’t really afford a voice-coach, but I’m serious about wanting to perform as a singer (mostly country/folk). It would be so much easier if a program were intelligently mapped out for me (how much of what to do when) Does anyone with knowledge in the field know a really good book I could use for this purpose?

  • Malcolm Hudson says:

    I was wondering how man..(through many years of course) created a device such as a computer, I mean..not the parts but how out of like an enviorment full of resources….do they come up with this electric device that can type letters , i mean what do they physically do to make this computer recognize letters…..its just a curiosity…And not only for computers but for other devices such as cameras..etc…

Leave a Reply to Andre Cancel reply

%d bloggers like this: