HOWTO Create a Readable PostScript or Pdf File out of a Man Page

I find myself often reading man pages of unix programs to be able to use the installed software more efficiently. That is one of the reasons I prefer to use a lightweight installation of "real" distribution instead of some tiny distributions that leave all the unncessary files like documentation out of the system to save some megabytes.

The standard output of man is unfortunately not very pleasant to read. But as man pages are written in a typesetting language called groff and processed through the groff engine, the same source can be used to produce a highly readable PostScript file. All you need to do is to use man with the following options instead of the ordinary man command:

man -Tps man > man.ps

This produces a PostScript file man.ps out of the man page for man. You can either use your favourite viewer for viewing the PostScript file, print it out to a printer, or convert it with ps2pdf to a pdf file, if you prefer a pdf.

ps2pdf man.ps

The following screenshot shows man page man as a pdf file, viewed with xpdf.

Using Keyboard Shortcuts with IceWM

Some time ago I wrote a short IceWM tutorial. As you might remember, IceWM is one of my preferred lightweight window managers. It's not too demanding for the system resources and can thus run very well on my rather old computers.



IceWM has so many hidden features that it is not possible to deal with all of them in a single tutorial. One of the features I left out from my tutorial was using keyboard shortcuts for more efficient use of the desktop.

The keyboard shortcuts are configured by the file ~/.icewm/keys. Your distribution might have added some definitions already, or you could copy the default shortcuts from the file /etc/icewm/keys. The syntax used for configuration is pretty evident, just follow the example of the default file.

My settings are rather simple:

key "Alt+Ctrl+t" xterm
key "Alt+Ctrl+e" emacs
key "Alt+Ctrl+f" firefox

Now I can start xterm by pressing Alt+Ctrl+t and Emacs by pressing Alt+Ctrl+e. You should define your own keyboard shortcuts, too

HOWTO Read rtf Files in Linux Console

Today I continue where I finished yesterday. I have so far written about reading doc and pdf files in Linux command line. Today I turn to rich text format, that is the files with extension rtf. Rtf is a very common format used by those who are at least slightly familiar with the compatibility problems caused by using Word's binary file format. Also rtf can be viewed using lightweight tools, it is not necessary to use OpenOffice.org to read the file.

I was reminded by my reader Reidar about catdoc, yet another Linux tool for reading windows file formats. As I don't have MS Word installed on any of my computers, I used Abiword for writing a short text (in fact this blog posting!) and saved it as a rich text file. And I was not disappointed by catdoc. It printed the content of my file on screen just like cat would do with an ordinary plain text file. You might be able to find it in the repositories of your distribution.

Catdoc is a tool that doesn't attempt to analyze and reproduce file formatting. It just extracts readable text from the file. What it can do, is to handle all versions of Word and convert character encodings. It can also read RTF files and convert Excel and PowerPoint files. You should install it in any system running on an old computer.



I thought that there are no console editors that can edit rich text files. I was not even sure whether it such editors would make any sense. But as I knew that Emacs can do everything one might some day need to do with her computer, I decided to google for "Emacs rtf". Surprisingly, or maybe not, there actually is an Emacs extension for editing rich text files and VIM should be able to edit rtf files out of the box. We are living in a strange world, aren't we?

HOWTO Read PDF Files in Console

I wrote about using Antiword for reading .doc files on the commandline yesterday. I think I get at least as oft pdf (portable document format) files attached to emails as I get .doc files. There are, of course, several alternatives for viewing pdf files when one is using X windows. You can, for example, use Evince, Kpdf or Xpdf for viewing the omnipresent pdf files.

I happen to read my email through a ssh connection on an Unix or sometimes a Linux system of my university. In order to view a pdf file, I have to save the attached file and use sftp to download the file to my desktop if I want to read it using a graphical pdf viewer.

Fortunately, there is a command line alternative even for reading pdf files! These can of course be used not only in a remote system over a ssh connection, but in any lightweight Linux system, even with a system with no X installed.



Ps2ascii uses Ghostscript for the conversion. It can convert both PostScript and PDF to ASCII text. It does not produce perfectly formatted output, but is certainly good enough for a quick & dirty conversion to have a glance at the textual content of a pdf file as the screenshot of Debian Reference shows.

HOWTO Read .doc Files in Console

We all receive .doc files attached to our emails. Sometimes we just have to read them, no matter how much we despise documents written with MS Word, or people who use MS Word.

There are several alternative solutions for the task. One, and probably the easiest solution, is to use OpenOffice.org Writer for reading documents produced with MS Word. A lighter solution would be to use Abiword. If you are using KDE, you could try Kword for opening the file. All of the mentioned word processors can pretty well import documents in .doc format.



Very often, all I need from a document is its textual information. It does not matter for me what is the used font and how well or poorly the document has been formatted. In this case, I usually do not bother to open a word processor just to read a document. All I need is a command line application, antiword. Antiword has been ported to a wide selection of operating systems ranging from DOS to Amiga. So it does not surprise at all, that it is available also for Linux. Use your distributions package management application for installing it.

Antiword is able to convert Word documents to plain text, to PostScript, to PDF and to XML/DocBook. My needs are more modest, plain text is all I need.

Antiword is a command line tool. Thus, all I need to convert this text from antiword.doc to plain text and read it through a pager is:

antiword antiword.doc | less




I can't imagine a simpler solution to this problem caused by the widespread use of proprietary binary file formats. Unfortunately the latest version of Antiword dates from 2005. It does not yet convert files written in the latest 2007 incarnation of the binary bloat.

Htop Is Better Than Top



Most users of Linux are familiar with top, a process viewer that displays Linux tasks in console providing a real-time view of the running system. It shows a lot of information that can be useful when trying to build a lightweight system using some standard distribution instead of a lightweight distribution. Unfortunately, top is not very pleasant to look at, and it lacks some useful functionalities.

This is where htop shines. As you can see, it uses colors and thus provides a lot nicer view than top. Htop also shows CPU and memory usages as bars rather than percentages. In addition, its keyboard shortcuts are clearly shown in the bottom line. There are keyboard shortcuts for e.g. searching, organizing the view as a tree, changing the niceness of processes and even killing them.


Htop is certainly available for your distribution, be it Debian, Ubuntu, openSUSE or any other distribution. Give it a try, you won't look back to top!

Vector Linux 6.0 alpha 2 released

Vector Linux released the second alpha of its forthcoming release 6.0. In the first alpha, GNOME was the default desktop environment. It was, however, too bloated in the opinion of most of the alpha testers. Now lighter XFCE is installed as the default desktop environment. For people using old computers, LXDE is offered as a secondary alternative.

If you are willing to invest your time in trying new distributions, you could do worse than to try and install this alpha release. Linux distributions rely on the users for testing alpha releases, and the more people install and use these prereleases and file bug reports, the better the final version will be.