Is there a (RESTful) API for linux man pages?

I’m looking for a way to request linux man pages via the API, the closest I found is http://linux.die.net/man , however there are commands divided into 8 sections, for example gcc is in section 1: http://linux.die.net / man / 1 / gcc , and since it is not actually an API, so you get the full html page (sidebar and ads) in response.

Before I plow and try to do this, does something like this already exist?

+7
source share
2 answers

Why not just use your local pages? Man pages are simply nroff compressed text files. nroff is confusing and weird, but should be doable. The man page of the creation guide should make it clear.

To locate the files, use man -w COMMAND . On my machine, man -w man gives me /usr/share/man/man1/man.1.gz . Therefore, my user files are stored in the /usr/share/man subdirectories. It would probably be easy to index from there.

If you look heavy enough, someone probably already wrote a parser for man pages.

+4
source

Yes, it seems to work.

 [ root@test ~]# man -w ls /var/cache/man/cat1/ls.1.lzma (<-- /usr/share/man/man1/ls.1.gz) [ root@test ~]# 

You can also check online pages online at http://www.go2techschool.com/linux-all-commands.php

0
source

All Articles