Well, this isn't exactly what is shown on most documentation pages.
It's more or less a page dedicated to using heh. There's a bit
more to it than meets they eye, so here is how you use heh:
Opening a file
If you want to open a file (primary use of heh), type:
If heh does not have that particular extension or type in its
database, it will prompt the you for an application.
heh foo.pl bar.tex .bashrc *.gif
For inline database updating and opening type:
heh -i xfig foo.fig
This will update the database and open the file in one command.
Updating the Database
Updating the database can be done in several ways. The primary ways
(adding to and editing) are:
I've already described the -i option. Here are the other ways:
- opening a file with an unrecognized extension (as stated above)
- the -u option
- the -i option (inline)
a simple update: heh -u ps gv
This tells heh to open all files with extension ps to be
opened with gv. This can both change or add to the database.
You can set certain extensions to be associated or equivalent. For
instance, we all know that foo.html and foo.htm are
the same thing. So lets have them be opened by the same application.
For all you C++ programmers out there, you know that a bar.h,
bar.cc, and bar.template are associated (and have
the same syntax). So here's how you tell heh that they're
heh -e htm html
heh -e cc h template
This tells heh to open the files with the same application.
However, one of the extensions must already be in the database.
(perhaps that should be changed...) Also, if more than one of those
applications is already defined in the database, they will all be set
equivalent to the FIRST one that's defined in that list (they'll all
still be equivalent, but they'll be opened with the application that
the first one in the list was set to be opened with).
If you have associated extensions and would like to change the
application for all of them, here's how:
heh -ua cc xjed
This tells heh to open all files with an extension associated with
cc (perhaps h, template, cpp,
C) to be opened with xjed. If you don't use the
-ua (update all) option, it will only change the cc
extension's entry in the database.
To remove an entry or entries from the database:
heh -r c CC h mp3
This will remove ONLY these extensions from the database, NOT any of
their associated extensions (if any).
To set certain extensions to be ignored (such as bak or
heh -ie old bak whatever
This tells heh to ignore the bak, old, and
whatever extensions when looking for the 'real' filename
extension. For instance, foo.pl.bak will be opened as
foo.pl. heh does this recursively, so
foo.pl.back.old.whatever will still be opened as foo.pl.
Remember, the ~/.extensions file can always be edited by hand
for even more complicated user-specific details!!
Querying the database
To query an extension or extensions:
heh -qe c CC fig ps
This will print to the screen the applications that open those
extensions and will inform the user if it is not in the database.
To query an appliation or applications:
heh -qp xjed xfig xmms gv
This will print all extensions opened by those applications. It will
inform the user if the applications is not used.
To print out everything in the database:
This prints a list of all extensions and applications in the database.
For any of these queries, you can (optionally) tell heh which
database to query (term, X, or both).
heh -qe -X pl pro
heh -qe -term txt dat
heh -qa -both
To view the current version number:
To view the help menu:
Pseudo extensions and applications
There are some files that have no extension or are not exactly a file.
We have incorporated them into heh as pseudo extensions:
There are some applications that we have provided to give heh
that aren't really applications:
- .NOEXTENSION_T - This is a text file with no extension or
a dotfile that is text only.
- .NOEXTENSION_B - These are files without extensions that
are binary (and thus will not be opened).
For example: heh /bin/bash
- .DIRECTORY - This is for opening directories.
For example: heh ~
- .URL - If you would like to open anything of the form
http://, file://, ftp://, etc.
For example: heh http://www.google.com
- .MAILTO - Filenames of the form mailto:
For example: heh mailto:firstname.lastname@example.org
- _.IGNORE._ - ignores files with the given extension
- _.EXTIG._ - does not ignore the file, but ignores the
extension. For example, if you tell heh to open files of
extension bak with _.EXTIG._, heh will
ignore the .bak and use the rest of the filename
(foo.pl.bak will be opened with the application for pl
- _.SCRIPT_ALIAS._ - this isn't really a valid handler, but
You can write shell scripts in the /etc/extensions_aliases (as
root of course). We have provided three (one for .URL's, one
for .DIRECTORY's and one for .MAILTO's) for
convenience and as examples.
This page last modified May,29 2001