Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

man is the quick interface to online reference manuals. These are usually stored in /usr/share/man/manN/blah.gz, or similar. Most debian packages also come with a README.debian, which is stored in /usr/share/doc/blah/README.debian. Is there an automated reader for these files, that finds the appropriate README.debian, and opens it?

share|improve this question
add comment

2 Answers 2

You can create a simple shell function and place it in your .bashrc:

readme() {
  if [ -e /usr/share/doc/"$1"/README.Debian ]; then
    "$PAGER" /usr/share/doc/"$1"/README.Debian
  else
    echo "No README for $1"
  fi
}

Use:

$ readme vlc

$Id: README.Debian 1436 2008-08-31 23:06:34Z xtophe-guest $

Notes for anyone wanting to build Debian packages of VLC.

 - Default configuration is supposed to be latest unstable.

 - VLC does not link with libdvdcss by default, thus it will not depend
   on the libdvdcss packages. However it will use libdvdread that can
   optionally open libdvdcss if found. To build packages that link directly
   against libdvdcss, remove the --without-dvdcss flag in debian/rules.

$ readme foobar

No README for foobar

You can smarten it up a little when you look for other README files (like the compressed ones which are often present) if the Debian file does not exist. Or collect all README files and offer a choice from which the user can select which one to display.

share|improve this answer
    
You might want to replace less with "$PAGER" to mimic man. –  Chris Down Dec 25 '12 at 12:40
    
@ChrisDown Good point. I updated the snippet. –  Marco Dec 25 '12 at 13:13
add comment

The easiest way is to type zless /usr/share/doc/blah/ and press Tab. Less is the text viewer that man calls by default, and zless is a wrapper that automatically decompresses .gz files.

You may want to install the packages dhelp or dwww. Neither does exactly what you want, but dwww is close: it lets you browse all of a package's documentation via a local web server. Dhelp doesn't require a server but doesn't show all non-HTML documentation.

share|improve this answer
1  
They're often not gzipped, also, presumably they can sometimes be in /usr/local/share/doc/, so it'd be good to automatically find the appropriate file, without typing it manually. –  naught101 Dec 25 '12 at 9:54
1  
@naught101 zless can read both gzipped and uncompressed files automatically. –  Brian Marshall Dec 25 '12 at 12:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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