ShellTools v0.1.0

(c) 2001-2005 Matt Chisholm

matt dash shelltools at theory dot org

ShellTools is a set of Python tools designed to enhance the standard *nix set of command line tools. It has four subparts:

I consider a number of these programs as experimental, proof-of-concept, or as demonstrations for enhancements that could be made to existing programs. To that end, they are licensed under the GNU GPL and I would be glad to see their functionality incorporated into other projects. However, that is not to say that they are not ready for everyday use; I use them all the time and find them very robust.

The latest version is available from http://www.theory.org/~matt/shelltools/download/

Termfile

These tools provide a number of alternative display methods for groups of files. There are five different displays:

All of the Termfile programs support the user's dircolors, if they exist. They all take the same set of command line options:

Basic options:
  -a          list all files
  -d          list directories only
  -h          show this help
  -l          list mode (display all file information, total # files)
  -L          show symbolic link targets
File information options:
  -p          display permissions (in octal)
  -u          display username
  -g          display group
Size display options:
  -s          display file-size intelligently
  -b          display file-size in bytes
  -k          display file-size in kilobytes
  -m          display file-size in megabytes
  -G          display file-size in gigabytes
  -T          display file-size in terabytes
  -P          display file-size in petabytes
  -i          use 1024 bytes in a kilobyte (kibibyte) (default)
  -y          use 1000 bytes in a kilobyte
  -U NUMBER   use NUMBER as block size
Time/date display options:
  -t          display modification time intelligently
  -t TIMEFMT  display modification time according to timefmt (see man date)

Movetools

Movetools is a set of commands for moving sets of files. When moving a large group of files, the entire group is checked for name collisions against the before any of the files are physically moved. When a name collision is encountered, the colliding files are compared by size and md5sum, and if the files appear to be the same, the moved file will be silently removed. After the entire set of files is compared for collisions, the program either moves the files, or reports the collisions to the user and exits, without altering any files. There are three basic commands:

Recursive checking of subdirectories is planned for a future release.

Grab - Drop - Lose

The grab - drop - lose set of commands is for selecting a group of files to move in several steps, and then selecting a set of destinations for some or all of those files at a later date. It can be thought of as a superset of the Copy & Paste interface for moving files in some common GUI file managers. It consists of four commands:

Here's an illustration of how to use grab - drop - lose set of commands. Assume I have some files in a directory that I want to organize into various places. First, I grab the files:

$ grab.sh image.jpg README.txt script.py

Then, I go looking for where I want to save README.txt, and cd to the directory where I want to move it to, and drop it:

$ drop.sh README.txt

Then, I notice that there is another file in this directory that I want to reorganize too, so I grab it too:

$ grab.sh picture.gif

Then, I go looking for a place to put image.jpg and picture.gif, but in the meantime I decide that I don't actually want to change the location of script.py, so I lose it:

$ lose.sh script.py

Finally, I find a good place for picture.gif and image.jpg, but first, I want to make sure I haven't grabbed any other files along the way by accident:

$ grablist.py
/home/user/path/to/picture.gif
/home/user/other/path/to/image.jpg

Now I'm ready to drop both files into the current directory:

$ drop.sh

That's it. I've moved three files from two different locations into two other different locations, without having to plan out beforehand what I was going to put where.

Number list tools

The number list tools are for displaying and manipulating sets of files with numerical, sequential names.