Here are some of my UNIX utilities, mostly scripts, which you may
find useful for various chores. Also check
my notes on shells. After copying these
scripts to your system, make them executable by using UNIX command:
chmod u+x Scriptname
- sets generates the
union, intersection or set difference of two sets, where each set is a file
and the elements of the set are the lines in the file.
- tarnewest GNU tars all files in a directory
newer than the file TIMESTAMP and compress the tar file in anticipation of
file transferring to another computer.
If you have no TIMESTAMP file or the timestamp is inappropriate use
touch -t MMDDhhmm TIMESTAMP
first. The script may need to
be modified slightly to point it to your system's GNU tar.
- openup is similar to
chmod -R go+r dirname
but unlike chmod it treat links, directories and executables correctly.
openup
recursively descends the given directory giving each file the same "group"
and "other" read and execute permissions as those for the owner. It removes
write permission, if any, for "other".
- Which is similar to Korn shell's "whence -p" and
C-shell's "which" except
Which
lists all files on your PATH
which match the given file pattern. An option exists to do the same
for man entries using MANPATH. Where multiple files with the same name
are found, the first one would be the command run by the shell.
- extension_change renames all files
with given extension to ones with a new extension. Supply the old extension
as the first argument, the new extension as the second, and the (old)
filenames as the remaining arguments.
- kase renames files forcing all characters in
the filenames to lowercase.
- Some trivial utilities for handling commands that require confirmation
are:
- yes which just prints endless y's. You might use
this as follows:
yes | rm -f dirnames
when the rm command needs
repeated confirmation to override protections.
- n and y are dummy commands to catch
extra y's or n's typed to some commands.
- 80 prints a ruler of length 80 characters.
Last update: 2009 January 21