man pages in your browser

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

man pages in your browser

Postby Habitual on Sat Jan 14, 2012 8:22 pm

You can force your browser to open man pages with this simple trick:

Terminal >
Code: Select all
vi + ~/.bashrc
and add:
Code: Select all
export BROWSER=firefox
alias manb="man -H"


Save and exit vi using either ZZ or :wq!
Code: Select all
source ~/.bashrc


Now in terminal type
Code: Select all
manb date
and firefox will gladly open it.

Another GUI'ish method to get man pages "graphically" is to use
Alt+F2 > "yelp man:date"

Enjoy.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Linux Mint is funded by ads and donations.
 

Re: man pages in your browser

Postby mads on Sun Jan 15, 2012 2:31 am

Thanks. :D
User avatar
mads
Level 6
Level 6
 
Posts: 1309
Joined: Wed Nov 03, 2010 3:44 pm

Re: man pages in your browser

Postby Jesse654 on Sun Jan 22, 2012 3:48 pm

I tried this and got an error:
man: command exited with status 3: /usr/bin/zsoelim | /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl | groff -mandoc -Thtml

I used gedit to modify my .bashrc, so I was wondering whether gedit or vi was playing a trick on me. :) As it turned out, I went into Synaptic Package Manager and found that I had groff-base installed but not groff (on my LM9-gnome system). groff's description includes, "This package contains additional devices and drivers for output to...HTML... " So I installed groff and voila, it works fine.

Thanks, Habitual, way to find a useful option!

Do you know of an analogous one for the info pages?

Check out http://linux.die.net/ too.
Jesse654
Level 2
Level 2
 
Posts: 96
Joined: Thu Sep 02, 2010 8:04 pm

Re: man pages in your browser

Postby MALsPa on Sun Jan 22, 2012 5:57 pm

Thanks, Habitual. I tried this in Ubuntu 10.04, but used "chromium-browser" instead of "firefox." At first I got the same error messages as Jesse654 got, so I installed groff, and it worked.

Could someone explain why it is necessary to run the following command:

Code: Select all
source ~/.bashrc
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby Jesse654 on Mon Jan 23, 2012 12:26 pm

MALsPa wrote:Could someone explain why it is necessary to run the following command:
Code: Select all
source ~/.bashrc

The file .bashrc is being changed. The source command reloads .bashrc. If you logged out, then logged in again, .bashrc would be reloaded automatically.
Jesse654
Level 2
Level 2
 
Posts: 96
Joined: Thu Sep 02, 2010 8:04 pm

Re: man pages in your browser

Postby MALsPa on Mon Jan 23, 2012 1:49 pm

Jesse654 wrote:
MALsPa wrote:Could someone explain why it is necessary to run the following command:
Code: Select all
source ~/.bashrc

The file .bashrc is being changed. The source command reloads .bashrc. If you logged out, then logged in again, .bashrc would be reloaded automatically.


Thanks!

By the way, couldn't get this to work in PCLinuxOS:

Code: Select all
steve[~]$ source ~/.bashrc
bash: TMOUT: readonly variable
steve[~]$ manb date
What manual page do you want?
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby Habitual on Mon Jan 23, 2012 3:16 pm

MALsPa wrote:...By the way, couldn't get this to work in PCLinuxOS:...


Can you shoot me output of
Code: Select all
echo $BROWSER && type -t manb


please.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Re: man pages in your browser

Postby MALsPa on Mon Jan 23, 2012 3:24 pm

Code: Select all
$ echo $BROWSER && type -t manb
chromium-browser
alias
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby Habitual on Mon Jan 23, 2012 3:25 pm

MALsPa wrote:
Code: Select all
$ echo $BROWSER && type -t manb
chromium-browser
alias


Try "export BROWSER=firefox" just for grins and giggles?

then "manb date".

I'm curious.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Re: man pages in your browser

Postby MALsPa on Mon Jan 23, 2012 3:28 pm

Code: Select all
steve[~]$ export BROWSER=firefox
steve[~]$ manb date
What manual page do you want?
steve[~]$
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby Jesse654 on Mon Jan 23, 2012 3:40 pm

MALsPa wrote:By the way, couldn't get this to work in PCLinuxOS:
Code: Select all
steve[~]$ source ~/.bashrc
bash: TMOUT: readonly variable
steve[~]$ manb date
What manual page do you want?

While I'm not a bash expert by a long shot...
Does it work if you logout, then login again? Is BROWSER (or manb) already set in .bashrc (and made readonly)?
Jesse654
Level 2
Level 2
 
Posts: 96
Joined: Thu Sep 02, 2010 8:04 pm

Re: man pages in your browser

Postby MALsPa on Mon Jan 23, 2012 3:59 pm

Jesse654 wrote:
MALsPa wrote:By the way, couldn't get this to work in PCLinuxOS:
Code: Select all
steve[~]$ source ~/.bashrc
bash: TMOUT: readonly variable
steve[~]$ manb date
What manual page do you want?

While I'm not a bash expert by a long shot...
Does it work if you logout, then login again? Is BROWSER (or manb) already set in .bashrc (and made readonly)?


Doesn't work after logging out and logging back in. BROWSER and manb were not set in .bashrc until I set them.

PCLOS is a kinda different animal sometimes, so this isn't a big deal -- don't spend a lot of time on it unless you really feel like it. I kinda researched the following output:

Code: Select all
steve[~]$ source ~/.bashrc
bash: TMOUT: readonly variable


Decided not to pursue this thing in PCLOS. But I'll try it in Fedora and see what happens.

Edit: Works fine in Fedora 16. And groff was already installed there.
Last edited by MALsPa on Mon Jan 23, 2012 4:08 pm, edited 1 time in total.
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby Habitual on Mon Jan 23, 2012 4:07 pm

/me is stumped.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Re: man pages in your browser

Postby MALsPa on Mon Jan 23, 2012 4:47 pm

The thing is, I don't think I'll actually use this very often. Being able to view man pages in a browser is convenient at times -- I'd do so every now and then with Konqueror in KDE -- but sometimes it's just as convenient to export the man page to a text file.

Still, this is a nice hack to know about. Thanks for starting this thread!
User avatar
MALsPa
Level 8
Level 8
 
Posts: 2030
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: man pages in your browser

Postby AlbertP on Mon Jan 23, 2012 5:07 pm

You can also see many manpages on http://linux.die.net
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6517
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: man pages in your browser

Postby Jesse654 on Mon Jan 23, 2012 5:19 pm

AlbertP wrote:You can also see many manpages on http://linux.die.net
Getting a feeling of deja vu. :)

Jesse654 wrote:Do you know of an analogous one for the info pages?
I think I found an answer to my own question via Habitual's other tip:
Alt+F2, then "yelp info:date"
gives the info pages in a GUI format. I bookmarked the Top section. Funny about the links: Clicking doesn't activate them for me; I need to right click and choose "Open Link."
Jesse654
Level 2
Level 2
 
Posts: 96
Joined: Thu Sep 02, 2010 8:04 pm

Re: man pages in your browser

Postby AlbertP on Tue Jan 24, 2012 6:59 am

You're right Jesse. I think I have overlooked some posts while reading this topic.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6517
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: man pages in your browser

Postby Habitual on Tue Jan 24, 2012 12:13 pm

Jesse654 wrote:
AlbertP wrote:... think I found an answer to my own question via Habitual's other tip:
Alt+F2, then "yelp info:date"...


But wait, there's more ...
Man pages by 'default' clear the screen after viewing. Sucky
When I was a noob, I thought this was a cruel 'feature'.

This is one of my personal favorite c-li 'hacks'...

Code: Select all
echo "export LESS='FiX'" >> ~/.bashrc
source ~/.bashrc


type man bash and scroll a page or 2 (or 20!) then Q for exit.

It stays on the screen.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Re: man pages in your browser

Postby AlbertP on Tue Jan 24, 2012 12:41 pm

That's one quote too much, Habitual. You're quoting Jesse (who has indeed quoted me too in the same post).
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6517
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: man pages in your browser

Postby Habitual on Tue Jan 24, 2012 12:45 pm

I resemble that remark.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2140
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided

Linux Mint is funded by ads and donations.
 

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 6 guests