Man pages offline for e-reader?

This bash command will dump HTML files for every man page on the system. You'll need to install the groff package first, then cd to an empty directory and run:

for f in `ls -1 /usr/share/man/man*`; do n=`echo $f | sed s/[.].*[.]gz//`; man -Thtml $n > $n.html ; done

This will cycle through all of the files in the /usr/share/man directory, strip off the section number and the extension using sed, then call man to render the manpage to HTML (man -Thtml in turn calls groff, which is why you need it installed first), storing the result in an html file with the same name as the page. It will take a while to complete, and groff throws some warnings about line breaks, but when it finishes, you will have all of your man pages in HTML format.

Most e-readers can handle HTML files, but if yours doesn't, you can use calibre to convert the HTML files to mobi or epub or any other format you choose.


all man pages are located at

/usr/share/man

But they're compressed in .gz files. Also there's a web where you can see all man pages online. I guess if you search a software who gives you the possibility to download all content of each page/link, you can create your own man-pages library for e reader


You can ask to man to convert a manpage into HTML and then running a command to display it. So you can import a man page directly into calibre with (If you obtain something like command exited with status 3, install groff package):

man --html=calibre YOUR_MANPAGE

You can also import you manpage to calibre database without running GUI:

man --html='calibredb add' YOUR_MANPAGE

Once your manpage is in calibre, you can easily send them to your e-reader (I suggest to send them as .mobi format).

Now, just iterate over the list of manpage you want to import:

find /usr/share/man/man[1-9] -type f | xargs -l man --html='calibredb add'