Main Help Page | Home Page (Internet) | Menus and Windows | Release Notes

This page documents the following Unix ports. All of them are subsets of their Unix equivalents, and many have a different syntax:

diff

diff is a small subset of its Unix counterpart. diff will compare two ascii files, showing which lines are different:

diff file1 file2

The entire text of the first file is listed, with differing lines from file1 prefixed by '<' and lines from file2 by '>'.

This diff only works on two ascii files at a time. Try out diff on two of the .INF files in Zoom Shell's home directory. They differ at only one line:

diff DesktopIcon.inf ProgramsIcon.inf

du

du is a subset of the Unix "du". It builds a report on disk usage for various files or directories.

du (build a report on the size of all files in the current directory and subdirectories)

du -. (only the current directory)

du c:\*.zip (amount space devoted on the C drive to "zip" files)

find

find is a small subset of the Unix "find." It searches for files which match an expression, and prints a list.

find c:\*.tmp (generate a list of files -- recursively through directories)

find -. (generate a list of files in the current directory)

find -# (files modified # days ago or sooner)

find -+# (files modified more than # days ago)

find -l (include details - date and size)

find -d (descend through matching directories)

find -r (recursive -- which is the default. -r overrides the -. option.)

find -s (run silently (without status window))

Examples:

find -0 * (find all the files modified today in and under the current directory)

find -1 -. * ( find all the files modified today and yesterday in the current directory only)

find -+8 * (find all the files modified more than eight days ago in and under the current directory)

Descend

There is a subtle difference between the -d and the -r options. The -r option will not match directory names, so "find -r *.txt" will only find text files. Similarly, "find -r bu*" will find all files beginning with "bu." On the other hand, the -d option would find files beginning with "bu" in the parent directory, plus all the files in the directories which begin with "bu," plus their subdirectories.

For example, I keep my source code in directories off the parent directory named "build##," where "##" is a number. I also have a number of files named "bugs.txt," which are in the parent directory and its subdirectories. If I want to find all the files named "bugs.txt", I would issue the command:

find bu*

Partial output:

i:\pb_apps\bugs.txt
i:\pb_apps\build20\bugs.txt
i:\pb_apps\build21\bugs.txt
i:\pb_apps\Version1.1\bugs.txt

If I want to find all the files in all the build* directories, I could do this:

find -d bu*

Partial output:

i:\pb_apps\bugs.txt
i:\pb_apps\build20\bugs.txt
i:\pb_apps\build20\commander.pbl
i:\pb_apps\build20\extra.pbl
i:\pb_apps\build20\HELPDESK.PBL
i:\pb_apps\build20\utils.pbl
i:\pb_apps\build20\zshell.pbl
i:\pb_apps\build20a\web\help\alias.html
i:\pb_apps\build20a\web\help\batch.html
i:\pb_apps\build20a\web\help\clipboard.html

Note that in this case,

  1. Subdirectories of "bu*" are searched;
  2. Files named "bu*" in the parent directory are also included; and
  3. Files named "bu*" which are not in directories matching "bu*" are not found. The file named "i:\pb_apps\Version1.1\bugs.txt" would not be found.

Notes:

  1. For dates: The reason the plus sign has to follow a dash is that the plus sign is a valid filename character in Windows.
  2. This syntax is very different from that of the Unix find, mainly because this command shares the same argument interpreter as all the other Zoom Shell commands, but also to simplify the syntax. It would have been nice to support Unix syntax, but it would have required writing a different interpreter just for this one command. Please let me know what you think.

ls

ls lists files in two columns -- just the file names, without dates, sizes, or the path. Like the Unix ls, ls will use only one column if you direct the output to a file. ls supports the -r, -#,and -d options of the find command. The -l option is redundant to the ll command. ls also supports the -X option, that puts a "*" next to all the files that have an association, and a "/" next to directories. The supported -p option places a "/" next to directory names.

ll

ll lists files with the date, time, size and name. ll supports the -r, -#,and -d options of the find command. The -l option is irrelevant. The supported -p option places a "/" next to directory names.

grep

grep searches for a string in the files you specify.

The syntax for this grep is similar to that of the Unix version. The main differences are:

  1. This version allows you to exclude strings from the search;
  2. Case insensitivity is the default; "-i" makes a case sensitive search;
  3. This grep will search in subdirectories, too.

The supported options are:

-b Bare -- don't put file name on line

-c Count only

-C Count as well as show lines

-f Fastest -- get list of matching Files

-i Case sensitive search

-l Don't quote the line

-n Quote line numbers

-r Recurse through all the subdirectories

-s Suppress error messages and "current directory" messages

-v Find lines without the search string

Examples:

grep fox c:\henhouse\* (search for the string "fox" in the "henhouse" folder)

grep -r fox c:\henhouse\* (search subdirectories, too)

grep -frs fox c:\henhouse\* (just get the names of files that match)

Enclose with quotes any string or filename with a space in it. Single or double quotes will do, as long as they match:

grep "it's" "mister rodgers.doc" (search for the single quote, too)

In this version of grep you may enter strings to be excluded from the search before the string for which you are searching. No switch is needed to invoke this option. Any string before the search string is excluded:

grep eggs "ordinary chickens" fox c:\henhouse\* (search for the string "fox" in the "henhouse" folder. Lines containing the strings "eggs" or "ordinary chickens" will be excluded from the search.)

Regular expressions:

Regular expressions are supported in grep. The rules of regular expressions seem complex at first, but here are a few examples:

"Zoom"				Zoom
any letter			[a-zA-Z]
any number			[0-9]
not a number			[^0-9]
"a" followed by a number	a[0-9]
"a" not followed by a number 	a[^0-9]
starts with "http"		^http
ends with "theend"		theend$
one "a"				a
one or more "a"			a+
zero or more "a"		a*
"zoom" in any case 		[Zz][Oo][Oo][Mm]
any character			.
any number of characters	.*
a period			\.
a square bracket		\[

head

head will display for you the first 15 lines of a file.

head filename (display first 15 lines of a file)

head -20 filename (display first 20 lines instead)

kill

Kill will close the application you name.

kill microsoft word - document1 (closes Microsoft Word)

kill -9 microsoft word - document1 (forces closed Microsoft Word)

kill *notepad (closes all apps which have a title ending with "notepad")

kill untitled* (closes all apps which have a title beginning with "untitled")

kill *word* (closes anything with "word" in the title)

kill -a word (closes anything with "word" in the title)

kill -9 -a word (forces closed anything with "word" in the title)

The title of the application is not case sensitive. Kill alone allows the application to prompt you to save your data. Kill -9 will immediately shut down the application, and you will lose any unsaved data.

An asterisk ("*") in the middle does not act as a wildcard; the asterisk in "kill Oracle SQL*Plus" does not get expanded.

kill can also accept a process id. To get the process id of a window, just type in "ps." Windows 9x process ids appear as a negative number, so they have to be surrounded by quotes.

mailx

mailx is a command line interface for sending mail (not receiving it). It uses your MAPI mail program, such as Microsoft Outlook© or Microsoft Outlook Express©. mailx can handle attachments, subject lines, and multiple recipients.

mailx addressee <body.txt (the simple case -- no subject, not attachments)

mailx addressee <clipboard (send the text in the clipboard to the addressee)

mailx -s subject <file1 file2 addressee (the first file will be the body of the message; the second will be attached)

mailx interprets the command line as follows:

  1. The subject, if one will be used, must come first. If there is a space in the subject line, enclose it with quotes. There must be a space after the -s switch.
  2. Any word in the command line with a less than sign (<) before it will be interpreted as a file and read into the body of the message.
  3. Any word in the command line that is the name of a file will be included in the message as an attachment.
  4. Any word in the command line that does not meet the criteria above will be treated as an addressee.
  5. Addressees, attachment files, and body text files can be included in any order.
  6. The body text file should be plain text (text files, html files, and rich text files all meet this criterion).

If the mail program cannot send the message, mailx will give an error message, if the MAPI program gave Zoom Shell an error message.

To include a standard header in your messages, put the text of the header in a file called "mailheader.txt" in Zoom Shell's home directory.  To include a standard footer (signature), place the text in a file called "mailsig.txt" in Zoom Shell's home directory.

Microsoft Outlook© problems:

Outlook does not accept attachments (Outlook Express does). It can also insist on displaying a "Choose Profile" window, making automatic mailing impossible. To dismiss the "Choose Profile" window, one can use one of the many freeware programs available to dismiss annoying prompts.

paste

paste pastes lines from two files together, side by side. It can be used to make columns from smaller text files. It has a different syntax from its Unix counterpart, using the ascii equivalent rather than a cryptic identifier for the separator.

paste -32 file1 file2 (paste file2 to file1, using a space (ascii 32) as the delimiter)

paste -9 file1 file2 (use ascii 9, the tab (default))

paste -9,9 file1 file2 (use 2 tabs)

Do not try this in your own home:

paste file1 file1 >> file1 (a quick way to manufacture a big file)

ps

Very simple task list giving the window handle, the process id, and the window title. The -e parameter makes ps show invisible windows.

strings

strings finds all the strings in a file. By default, any string of letters or printable characters more than 4 characters long will be printed.

strings notepad.exe

strings -10 notepad.exe (find any strings 10 characters long or longer)

strings -t mydoc.doc (treat tabs as a string)

strings -r *.doc (recurse through subdirectories)

Notes:

  1. The algorhythm for determining what to print is very simple, and may leave much to be desired.
  2. This implementation is very slow, compared with some others.

tail

tail will display the last 15 lines of a file.

tail filename (display last15 lines of a file)

tail -20 filename (display last 20 lines instead)

tail will only read the last 32k of a file by default. That setting can be changed by the 'TailBuffer" parameter in the [Command List] section of the ZShell.ini file.

touch

touch will change the "write" date on a file (the one usually displayed), creating a file if none existed previously.

touch readme.txt (create a new, empty file if none existed)

touch readme.txt (give the current timestamp to an existing file, leaving contents alone)

touch [mmddhhmm[yy[yy]]] readme.txt (give a different date to a file)

touch -r *.txt (recurse through subdirectories)

This touch does not have an option to change the create or access dates. It assumes the current century if none is given. In good Unix tradition, it does not do error checking on the date.

which

which looks through the path for the first copy of an executable.

which write (Zoom Shell will tell you which "write" it would execute first)

If you don't supply an extension, Zoom Shell will try extensions in the following order: COM, EXE, BAT, CMD. The extensions are tried in the order they would be run from the console.

Zoom Shell's which understands aliases, unlike some of its counterparts. However, it does not know where to find any of the Zoom Shell internal commands -- it only looks for commands external to Zoom Shell.

Use which to debug problems with running applications. Windows looks for "white space delimited tokens" when searching for an executable. For example, Windows uses the following algorhythm to find the executable for "ascii table":

C:\Program Files\Ascii Table\Ascii Table.exe

  1. try "C:\Program.exe"
  2. try "C:\Program Files\Ascii.exe"
  3. try "C:\Program Files\Ascii Table\Ascii.exe"
  4. try "C:\Program Files\Ascii Table\Ascii Table.exe"

If the command line is enclosed in quotes, Windows will only try the first token:

"C:\Program Files\Ascii Table\Ascii Table.exe"

Table of Contents