When I type man bash it shows the info in the terminal itself.

How do I tell "man" to open up the info in gedit instead? Is this possible?


Use this function in .bashrc:

man () { yelp "man:$@"; }


| improve this answer | |
  • 2
    Thanks! This is better than gedit too (didn't know about yelp) – Zabba Apr 20 '11 at 0:00
  • 3
    Or just use yelp man:bash of course, if you are on somebody else's desktop. – JanC Apr 20 '11 at 12:18
  • 2
    And if you need a manpage that's not in the default section, use something like yelp "man:init(5)" instead of man 5 init (this doen't work with the current version of zengr's bash function). – JanC Apr 20 '11 at 13:47
  • That's very good. Still, I'd also like a method to index or browse the man pages by topic or a table of content. Is there anything like that out there that works on say just ubuntu or even just debian with X? – will Oct 1 '15 at 14:18

Simply enter the following in the terminal:

man bash >/tmp/t;gedit /tmp/t

That will create a temporary file with the contents of the man page and open it with gedit.

| improve this answer | |
  • An alternative command that avoids the creation of a temporary file, making use of Bash features: gedit <(man bash) – Lekensteyn Dec 23 '11 at 11:06
  • 1
    @Lekensteyn: gedit doesn't open a <() process substitution, nor does it open piped input. (tested in 2.30.3, and 3.4.1) – Peter.O Sep 4 '12 at 6:21
  • @Peter.O I just checked and you are true. It does not work for kate either. nano can open it as read-only though. – Lekensteyn Sep 4 '12 at 11:34
  • man bash | gedit - avoids the tmp file – Elliptical view Apr 8 '18 at 20:57

Better yet, have man format it in HTML and open it in firefox

# open a man page in firefox

# loop through all parameters in order
for i
    # if the manpage was found, spawn it in a browser window
    man -f "$i" > /dev/null && coproc man --html=firefox "$i"
| improve this answer | |
  • Excellent, I love it. +1 .. It is now a function in my ~/bashrc ... fman () { until [[ -z $1 ]] ;do man -f "$1" 2>/dev/null && coproc man --html=firefox "$1"; shift; done; } – Peter.O Sep 4 '12 at 7:02

If you don't want to use a shell: hit alt+f2 and enter yelp man:bash. A command history is also available, and you can choose any manpage by replacing man:bash with the manpage you need.

| improve this answer | |

As well as opening the man page in gedit (like the other answers have demonstrated), you can also make a pdf of the man page (as first noted in this article) and then display it in evince. (You need ps2pdf and evince installed). The pdf file is created in your present working directory and is retained after evince is closed.

Simply modify the command below according to the man page that you want and change the file names or else the resulting pdf files will be overwritten. Here is an example for dpkg:

man -t dpkg | ps2pdf - dpkg.pdf && evince dpkg.pdf

However, it is probably much more useful to construct a function. You could add the following function to your .bashrc or .bash_aliases (assuming you have evince and ps2pdf installed; the latter is in the ghostscript package):

mikman() { man -t "$1" | ps2pdf - "$1".pdf && setsid evince "$1".pdf; }

After adding the function, you have to run . .bashrc (or . .bash_aliases) to source your configuration files, or restart the terminal for it to take effect.

Call the function with the name of any program that has a manpage, such as mikman dpkg, and it will carry out the commands and launch the manpage as a pdf. Launching the manpage as a pdf in your pdf reader gives you a very useful gui wherein search tools and the like can be utilised.

| improve this answer | |

On a case-by-case basis you can do:

man mount > mount.txt

The .txt file will be in your current directory.

man mount > mount.txt && gedit mount.txt

will open the file in gedit.

| improve this answer | |

You can browse man pages on-line http://manpages.ubuntu.com/ or install dwww package and browse all documentation off-line (http://localhost/dwww). See description of dwww package and/or read man dwww after installation.

You may be also interested in browsing package contents – install dpkg-www package and do the same: See description of dpkg-www package and/or read man dpkg-www after installation. Start dpkg-www or browse http://localhost/cgi-bin/dpkg.

| improve this answer | |

This will create a temporary file with the manual page for bash in your home directory entitled "man" and open it with gedit. As soon as you close gedit the file will be erased too. Just replace bash with whatever man page you want to open.

man bash >> ~/man && gedit ~/man && rm ~/man

Hope this helps :)

| improve this answer | |
  • The problem with this is that gedit detaches itself from the terminal with an exit code of 0, so the rm step is executed immediately. This causes ~/man to be deleted before gedit has even loaded it... – Peter.O Sep 4 '12 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.