Tuesday, January 6, 2015

convert linux man page to pdf

man -t find | ps2pdf - find.pdf

export MANWIDTH=120
#unset MANWIDTH

How to print man pages:

       MANWIDTH
              If $MANWIDTH is set, its value is used as the line length for which manual pages should
              be formatted.  If it is not set, manual pages will be  formatted  with  a  line  length
              appropriate to the current terminal (using an ioctl(2) if available, the value of $COL‐
              UMNS, or falling back to 80 characters if neither is available).  Cat pages  will  only
              be saved when the default formatting can be used, that is when the terminal line length
              is between 66 and 80 characters.

Labels: ,

Monday, January 5, 2015

help vs info vs man


help commands
  1. help cd
  2. cd --help
  3. man ls
  4. apropos floppy
  5. whatis ls
  6. info coreutils
Source help is a built-in command in the bash shell (and that shell only) that documents some of the builtin commands and keywords of that shell. That's an internal documentation system of that shell. Other shells have their own documentation system (ksh93 has --help and --man options for its builtins, zsh has a run-help helper that extracts information from manuals in other formats). Other commands like vim have their own embedded documentation system.
man is a system-wide documentation system that provides short reference manuals (pages) for individual commands, API functions, concepts, configuration file syntax, file formats organised in sections (1 for user commands, 2 for system calls...). That's the traditional Unix documentation system.
info is another documentation system originating in the GNU project. It's hypertext with links (predates the web). An info manual is like a digital book with a concept of table of contents and (searchable) index which helps locating the information.
There's overlap between the 3. For instance, bash being part of the GNU project has both a man page and an info manual. The size of the manual makes the man system not as appropriate for bash though. However, the structure of the info manual and index is not very good in bash which makes it not as easy to look information in as in other info manuals like zsh's. zsh manual being even bigger is split into several man pages and also has a good info manual with a very good index.
It should be noted that the info manual is generated from a texinfo format which is also used to generate HTML and printable (PDF/PS) versions. In the case of zsh though, the texinfo is generated from another format (yodl).

Labels: ,

Saturday, November 1, 2014

How to bind a book

There are many ways to make a book:

1. Heavy Duty Stapler


Labels: