Shell Tools Page - Utilities for the Unix environment

Malcolm Carlock /

Copy a file to the same name but with date/time stamp appended

Bulk IP lookups
fff  ffl fffn
Quick file-find commands with unquoted wildcards
Check which host or DISPLAY we're logged in from
Apply custom X11 keymap for this user, if defined - requires fromhost
Create a new shell script skeleton that already contains common structures and comment blocks
Simple TCP port-checker for one or more ports and hosts - requires nc (netcat)
tzls  tzx
Quick Unix archive file content list and unpack
Portable .profile .kshrc .bashrc
Portable Unix dot-files that work on various platforms including Cygwin and MKS

click to view/download

Backup with Date appended.  Copy the specified file(s) to the same name, but with a textual date/time appended down to the current second.  The filesystem date/time stamp for the original file is preserved.

Usage:  bd file [ file .. ]

Example:  bd foo.txt   results in   foo.txt.2004-02-11-202410

click to view/download

Bulk / stream Resolution of IP addresses and hostnames
  • Resolve IP addresses and/or hostnames in bulk
  • Can read from STDIN, commandline or file
  • Can be used for quick commandline lookups, like host, dig and nslookup
  • Automatically detects which of the three is on your system, and uses whichever is available, in that order of preference
Usage:  brip [ options ] [ { hostname | ipaddress } ]

Detailed information regarding options can be viewed within
brip itself
fff, ffl and fffn
click to view/download

Quick, case-insensitive file-find with unquoted wildcards.  Options to find(1) can be appended if desired.


fff *some*pattern* [ *some*pattern* .. ] [ -{find-options} ]
find matching files/directories etc that match *some*pattern*, displaying the full path, one match per line

ffl *some*pattern* [ *some*pattern* .. ] [ -{find-options} ]
same as above, but displaying relative paths

fffn *some*pattern* [ *some*pattern* .. ] [ -{find-options} ]
same as fff, but displaying SSH-formatted network paths, one per file or directory

For an fff command at a WinNT/XP/Win2K DOS/CMD prompt, run the following command to create an fff "alias".  Sorry, no ffl or fffn capability or find(1) options.
doskey fff=dir/s/b/on $*

click to view/download

Display the client host or X11 display on which this command runs.  If DISPLAY is blank, or the command is running on the local host, nothing is displayed.

Usage:  fromhost

click to view/download

Set a custom X11 keymap for this user, if one is defined, based on the host on which this script runs, OR the remote host if it is run under a remote shell.  Depends on the fromhost command.

Usage:  myxkm

click to view/download

New (Bourne) Shell Script.  Creates a skeletal shell script containing:
  • Error-handling functions
  • Signal handling (trap settings)
  • Customisable commandline parsing
  • A comment-block at the top, reminding the programmer of various bits of useful documentary info that are nice to have in the script

Usage:  nss scriptname

click to view/download

A simple TCP port checker that wraps nc (netcat) for simple operations.

pc portnum[,portnum[..]] [host[,host[..]]


pc 22,80,443 localhost,luna,             results in:

localhost       22      OK
localhost       80      OK
localhost       443     FAILED (no response)
luna            22      OK
luna            80      FAILED (no response)
luna            443     FAILED (no response) 22      FAILED (no response) 80      OK 443     OK

pc 22               results in:

localhost       22      OK

tzls and tzx
click to view/download

Quick extraction and content-listing for the following archive and compression types:
bzip2 (bz2)
gnu zip (gz)
zip, rar, arj
compress (Z)
tzls [ -v ] filename  list contents
tzx [ -v ] filename unpack into current directory
Portable .profile and .kshrc files, usable with ksh/bash, under Unix, Cygwin or MKS
click to view/download

  1. Save the .profile and .kshrc files into your home directory (after backing up the ones you have, if any)  Also install this stub .bashrc.
  2. ln -s .bashrc .bash_profile
  3. Log in using bash or ksh

Powered by WebRing.