Is there a common location of all of the man files, so I can view them in a different editor instead of the cli?

Or is there a $ man dump command that I can use to export each individual man file for what’s installed

Thanks, Forever noob

8 points
*

the command manpath will show the paths it searches. usually it’s /usr/share/man and /usr/man is a common location for them.

permalink
report
reply
4 points

And the man path can be configured using the $MANPATH environment variable, just like $PATH.

Oh, and if you leave a colon : at the end of $MANPATH, then it’s like appending the default search path (which is binary specific I suppose).

permalink
report
parent
reply
7 points
*

Sometimes I find myself looking man pages up on linux.die.net/man and mankier.com. Distros like Debian have manpages.debian.org (all manpages in Debian) which are useful as a web-based reference too

permalink
report
reply
2 points

Nice, thanks for the tip!

permalink
report
parent
reply
28 points
*

You can list every man page installed on your system with man -k . , or just apropos .
But that’s a lot of random junk. If you only want “executable programs or shell commands”, only grab man pages in section 1 with a apropos -s 1 .

You can get the path of a man page by using whereis -m pwd (replace pwd with your page name.)

You can convert a man page to html with man2html (may require apt get man2html or whatever equivalent applies to your distro.)
That tool adds a couple of useless lines at the beginning of each file, so we’ll want to pipe its output into a | tail +3 to get rid of them.

Combine all of these together in a questionable incantation, and you might end up with something like this:

mkdir -p tmp ; cd tmp
apropos -s 1 . | cut -d' ' -f1 | while read page; do whereis -m "$page" ; done | while read id path rest; do man2html "$path" | tail +3 > "${id::-1}.html"; done

List every command in section 1, extract the id only. For each one, get a file path. For each id and file path (ignore the rest), convert to html and save it as a file named $id.html.

It might take a little while to run, but then you could run firefox . or whatever and browse the resulting mess.

Or keep tweaking all of this until it’s just right for you.

permalink
report
reply
2 points

Thank you for the insight! This is super helpful

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 7.4K

    Monthly active users

  • 6.6K

    Posts

  • 180K

    Comments