*     *    *   *  * * SLUnix * *  *   *    *     *

SLUnix - Søren Lund's Unix Page


I've been an UNIX user for many years now, and have created this page to share programs, scripts, tricks and information.

I have primarily used Hewlett-Packard's UNIX variant, known as HP-UX. I also have som experience with Linux, which I run at home.

One-liner How-to's

This section contains small how-to's. They give solutions to common tasks, like how do I print weird format files?

Displaying/printing man pages

Most programs on a UNIX system comes with at corresponding man-pages, the source of a man-pages is called program-name.n, where n is a number. If the program is properly installed issuing the command man program-name would display the man-page.

If the program isn't installed and you just have the man-page source, use the following:

> nroff -man program-name.n | more
> nroff -man -Tlp program-name.n | lp -dtext-printer
> nroff -man -Tlj program-name.n | lp -dpcl/laser-printer

Finding files modified less than a day ago etc.

List the files modified less than a day ago:

> find . -type f -mtime -1 -exec ls -l {} \;
exchange -mtime with -atime and you get files accessed within the last 24 hours.


Below is another way of acceiving something similar to the above:

> ll | grep "`date +"%b %d"`" | cut -c57- | xargs echo
this will list all files having a datestamp of today in the current directory. You can replace the echo command with whatever command, this way you could e.g. display all images in a directory with xv.

Space provided by:

Copyright ©1999
Søren Lund