Viewing MS Word files on Command Line

I had to urgently view a MS Word file but I didn’t have a word processor on my system to view it in, KWord2 beta wasn’t able to support MS Word files. And I couldn’t find any small word processor or the one that wouldn’t being a gnome and a half in with itself. So, I decided to explore the CLI way.

I came across this nice article on how to view MS Word files on CLI. One of those softwares which I tried out is antiword, as it seemed most suitable to my purpose. A nifty utility to download and use while Oo.org takes it’s sweet couple of hours.

Another nice thing is that it can be used when you don’t have X running or if you’re connecting via SSH.

Viewing the file in antiword is as simple as typing

antiword filename.doc

Though it has a few options to format stuff via parameters, I don’t need them. But, they can be quite useful for some purposes.

Pipe the document through a pager and nicely sit and enjoy reading your MS Word document over Command Line Interface.

My thoughts on the software – simple, easy to use and makes life easy when all you want is to view simple text from a MS Word document. What I miss the most in the software is the ability to open odt files 😦

Advertisements

Finch – IM Client for command line

Finch is an IM and IRC client for command line. It supports all the protocols supported by pidgin. Like pidgin, it makes use of libpurple. So, all your account configured for pidgin can be used on finch too .
It has nifty shortcuts based on alt keys to navigate around. Making it quite simple to use for those people who are faster with keyboard than with mouse. . Some frequently used shortcuts are :-

  • Alt + q – quit
  • Alt + c – close window
  • Alt + n – next window
  • Alt + p – previous window
  • Alt + a – View available actions
  • Alt + w – list of windows
  • Alt + m – move window
  • Alt + r – resize window
  • F10 – Show menu for current window
  • Alt + tab – next URGENT window
  • Alt + Shift + tab – previous urgent window

Not so difficult to remember the shortcuts. No use of mouse required at all
Alas! Keybindings don’t work under screen so I can’t run it in screen session rest everything is perfect.

Mirage – A lightweight GTK+ Image Viewer

Being a fluxbox user I have been looking for some lightweight imageviewer. xloadimage can always be invoked from CLI whenever needed.
While helping a friend build up a XFCE based gentoo system we discovered mirage. Mirage needs only pyGTK installed, which should be available on most linux distributions these days.
Some of the useful features of mirage are :-

  • Lightweight
  • Easy to use interface
  • Small app coded in python and GTK+
  • Supports various image formats like png, svg, jpeg, gif, etc.
  • Shows thumnails of all images in current directory
  • Displays basic information about size, resolution and compression of images in the status bar at the bottom
  • Supports basic editing features like rotate, flip, crop, resize, saturation,
  • It can also show images in the current directory as a slide show.
  • Option for viewing remote images
  • It can also take screenshots and save it in png format

Here’s a screenshot of mirage taken in mirage itself

Mirage image from Mirage

Mirage image from Mirage

More can be found on Mirage’s website
It has 4 modes for opening a file –

  • Smart Mode,
  • Zoom to Fit Mode,
  • 1:1 Fit Mode and
  • Last Active Mode.

Here’s the definition of smart mode, from mirage’s website

Smart Mode uses 1:1 zooming if the image is smaller than the available space and Fit Mode if the image is larger.

It also supports command line arguments, though they may not be utilized too much. Nonetheless it is available if needed.

Now, I have left it’s best part to the last. It supports custom actions eg. pressing ctrl +e opens the image in gimp, alt + t to create thumbnail of the image and so on. All these can be easily changed too by editing it’s values in Edit=> Custom Actions=> Configure. You can also add new values as to your liking

One great use of mirage I have found for myself is when using elinks for browsing certain websites which are supposed to be text based but I may stumble upon a couple of interesting sounding images. Mirage can then be easily invoked from elinks to view the images from the website.