The Command Line Utilities version 2.1 comprises a suite of native Pure 32-bit OS/2 commands that provide many useful abilities to the OS/2 user, as well as improved 32-bit versions of several of the 16-bit commands that are supplied with IBM OS/2 itself that allow one to remove more of the 16-bit vestiges that remain in OS/2 Warp.
They are "command line" utilities because they can all be driven from the command line, making them suitable for use in command scripts ("batch files"). However, the Command Line Utilities comprises a mixture of textual and graphical programs.
The Command Line Utilities have several features:
Ironically, this ability in the touch
and
xdir
commands has revealed two Year 2100 bugs in OS/2's
own FAT and HPFS filesystem drivers!
saydate
, setdate
, anaclock
,
digclock
, touch
, and unstamp
commands understand the timezone information supplied in the TZ
environment variable, using the standard POSIX (ISO/IEC 9445-1:1990)
syntax, and can operate in any timezone, in either hemisphere, with
daylight savings time changes happening automatically without manual
user intervention.
Different commands can thus be run in different timezones. So one
could have, if one wanted, multiple instances of digclock
running on the desktop at the same time, all operating in different
timezones and with different daylight savings time rules. A fully
configurable and extensible "world clock"!
For example:
[c:\]attrib +r *.{zip,arj,rar,lzh,tar.gz}
and
[c:\]xdir [a-c]*
and
[c:\]dump /s *.{su,mo,tu,we,th,fr,sa}[0-9]
attrib
, comp
,
find
, help
, sort
, and
tree
.
Needless to say, many of the uglier "features" of the OS/2-supplied commands have been removed.
sort
command can sort files
named on the command line as well as its standard input, and can sort
files that are greater than 64KiB in size.
comp
command can be used in a batch
file with ease, because it doesn't insist upon being interactive.
find
command supports regular
expressions and the ability to be used in a command pipeline.
help
command can be configured to
search different on-line books by default and won't destroy a
customised command prompt if one turns help on and off.
tree
command, unlike IBM's
tree
supplied with IBM OS/2, actually displays a
tree!
For example: Commands are not upset by very large directories.
The dir
command in IBM's cmd
, the
default command interpreter supplied with IBM OS/2, refuses to sort a
directory listing containing more than 2073 files. The
dir
command in JP Software's 4OS2 fails when the directory
size reaches a more respectable 20,000 files. But the
xdir
command was able, in testing, to sort a directory
listing of 100,000 files, and even that didn't reach its limit. (I
just ran out of enthusiasm to go any higher. (-:)
dump
, find
, grep
,
sort
, strings
, sum
,
tee
, textconv
, wc
,
what
, and y
commands can be used as filter
commands, for use in a command pipeline, acting upon what they receive
from their standard input, and producing results on their standard
output.
arcdir
, attrib
, convcase
,
dellname
, delthumb
, ff,
finddups
, fitsize,
touch
,
tree
, which
, xdel
, and
xdir
commands can produce file and directory listings in
colour, taking the colouring rules from the DIR_COLOURS
environment
variable.
COUNTRY
in
CONFIG.SYS
. They also use OS/2's system message file for
the text of error messages, and so will display system error messages
in the local language.
(Indeed, the tree
command was added to the Command
Line Utilities in version 2.0 because one of the popular
tree
utilities for OS/2 couldn't handle the
C:\OS2\ARCHIVES
directory tree and would always crash
because it was too deep!)
For example:
[c:\]ff /s/e \\server\sharename\*.txt
and
[c:\]xdir \\server\sharename\*.{exe,com,cmd}
DATE()
and TIME()
function to obtain the date and time in the
local "short" form (which REXX provides no built-in mechanism for
doing).
Here are the individual utilities:
anaclock
is a simple Presentation Manager analogue
clock program, with full support for timezones and automatic (and
effortless) switching to and from daylight savings time.
arcdir
displays the contents of archives. It
performs much the same function as the "l" or "-view" option to many
archiving tools, except that one tool supports multiple archive types with
one uniform command syntax, can list files within the archive matching
particular wildcards, can sort the listing, and can even produce a single
(sorted) list of the contents of multiple archive files that match a
particular wild card, optionally recursing into subdirectories to find
them.
attrib
is an enhanced, 32-bit, replacement for
IBM's 16-bit attrib
command. It includes, amongst other enhancements,
extended wildcards, the ability to include and exclude files by attribute,
and the ability to modify the attributes of subdirectories as well as
files.
bcomp
is a simple binary byte-for-byte comparison of two files.
calctz
is a Presentation Manager utility to help calculate the
TZ environment variable string for any given timezone and daylight savings
time rules. Unlike other TZ calculators, this command calculates a TZ
string that is in the standard POSIX 1003.1 (ISO/IEC 9445-1:1990) format.
comp
is an enhanced, 32-bit, replacement for OS/2's 16-bit
COMP command. It doesn't prompt the user, so can be used in command
scripts, and has a more compact output format so that differences are
easier to spot. It can also recurse into subdirectories to compare entire
directory trees; and it supports extended wildcards.
convcase
renames filenames to upper, lower, or mixed case,
which is handy in those situations where other programs insist upon
creating all-uppercase or all-lowercase filenames. It supports the
standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
cpuidg
is a Presentation Manager program to display the
information obtained about the CPU by the CPUID instruction, including the
various AMD and Cyrix extensions.
cpuidt
is a text-mode program to display the information
obtained about the CPU by the CPUID instruction, including the various AMD
and Cyrix extensions.
cyclog
is a daemon that logs whatever it receives on its
input to a set of log files, keeping a cap on the space that they consume by
recycling the oldest logs.
deltree
is a REXX wrapper script for the
xdel
command that behaves much like the deltree
command in MS-DOS and DR-DOS does.
dellname
removes the long names that are stored in the
extended attributes of files and directories by Workplace Shell programs.
It supports the standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
delthumb
removes the thubmnail icon images that are stored
in the extended attributes of files and directories by some programs. It
supports the standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
descedit
is a Presentation Manager program to display the
descriptions for files and directories store in extended attributes, and
to allow them to be easily modified. It supports the standard CLU
features of recursing into subdirectories, including/excluding files by
attribute, and extended wildcards.
digclock
is a simple Presentation Manager digital clock
program, with a fully configurable display format and full support for
timezones and automatic (and effortless) switching to and from daylight
savings time.
dirsize
displays the sizes of directories, much like the GNU
`du' command does, but with the standard CLU features such as enhanced
wildcards and the ability to include/exclude files by attribute, and with
the same simple, consistent, PC-style, interface of the other utilities
that should be familiar to OS/2 users. It also displays the actual true
"allocated space" figures when used on large FAT volumes.
dump
dumps the contents of many types of file, including the
popular ARC, ARJ, LZH, RAR, ZIP, and ZOO archive file formats, PKT files
(used for mail transfer on Fidonet), executable and DLL files, and Intel
object module files (OBJ and LIB files).
dupdir
brings a target directory into synchronisation with a
source directory by copying new or newer files and deleting files that no
longer exist. Supports recursing into subdirectories, so that entire
directory trees can be synchronised, and the standard CLU features such
as enhanced wildcards and the ability to include/exclude files by
attribute.
ff
is a versatile yet simple and fast file finder, that is also
capable of locating files that are contained within ARC, ARJ, LZH, RAR,
ZIP, and ZOO archives. It supports the standard CLU features of
recursing into subdirectories, including/excluding files by attribute, and
extended wildcards.
find
is a REXX wrapper for the
grep
command that can replace
OS/2's 16-bit find
command, searching for lines in text files that contain
a given string. It has the standard CLU features of being able to
operate recursively on files in subdirectories and include/exclude files
by attribute. It can also has a "brief" display format, and the ability
to display counts of the number of lines found.
finddups
locates files that are exact duplicates of one
another, even if they have different names and timestamps. It supports
the standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
fitsize
groups files into bundles that don't exceed a given
total size. It is useful for burning CD-ROMs, or collecting files onto
LS-120 super-floppy discs.
grep
finds lines that match a given pattern in text
files, much like the GNU egrep
command, but with the standard
CLU features. It implements almost the entire POSIX "extended" regular
expression syntax -- far more than most other grep utilities, which
usually only provide the POSIX "basic" syntax.
head
outputs the first few lines of its input, which can
either be a number of files specified on its command line or its standard
input. It supports the standard CLU features of recursing into
subdirectories, including/excluding files by attribute, and extended
wildcards.
help
is an enhanced, REXX, replacement for OS/2's
HELP command (which is a "batch file"). It won't upset customised
PROMPT
strings, and doesn't require the 16-bit
HELPMSG
program in order to function. It also allows the
command reference on-line book that is used by default to be configured
via the CMDREF
environment variable.
It is also useful as a replacement for the help command that is built in to JP Software's Take Command for OS/2, which doesn't work too well.
newmbr
writes a new Master Boot Record, enabling
enhanced features in one boot manager, to a partitionable disc.
partlist
displays the entire, unmodified, contents
of the partition table on one or all of the available partitionable disc
devices, including the partition names. Unlike FDISK /QUERY
,
the partition table is displayed in raw uninterpreted form, with the
partition sizes displayed in numbers of sectors, rather than being
converted to KiB.
The /FIXCHS
option will fix some of the more common errors
caused by disc geometry changes (which can occur when a disc is moved from one
machine to another or when a different make of SCSI host adapter is used, for
example).
The /FIXTYPES
option will turn type 0F extended partitions,
which IBM OS/2 cannot understand, into type 05 extended partitions, which it
can.
playmorse
plays Morse code through the PC speaker. The dot
speed and beep frequency are configurable, and the code can optionally be
displayed as it is played.
playtune
plays a tune through the PC speaker. No
more messing around converting a tune to a series of numbers for
BEEP
s! And no more need to run QBASIC
in a VDM,
which eats CPU time, just to play a tune! The tune is given in a format
compatible with the "PLAY" statement in the BASIC language and with
so-called "ANSI music" as used by several BBS and offline mail and comms
utilities.
resetini
removes the read-only attribute from the user and
system INI files, and then instructs Workplace Shell to reload them. It
is useful as an aid to recovery if an incomplete shutdown has left the INI
files read-only by accident. It also has the side-effect of closing and
re-opening the WPS Desktop folder without restarting the system.
runsvc
is a service manager, to control services. The
Service Manager spawns and terminates the service process under remote control
from the service control utility. The environment, working directory,
arguments, and name of the service program are read from a configuration file
and may all be modified on the fly, allowing a service to be taken down,
reconfigured, and restarted without restarting the system as a whole.
saydate
displays the current, or any given, date and time,
with a fully configurable display format and full support for timezones
and automatic (and effortless) switching to and from daylight savings
time. The date
and time
commands built in to
IBM's 16-bit cmd
cannot be used in command scripts to display
the date and time without some ugliness, because they prompt for input.
This command can be!
service
controls services by sending commands to their
service managers.
setbootg
is a Presentation Manager configuration utility
for IBM's and other compatiable boot managers.
setdate
allows the hardware real-time clock to be set from a
date or time expressed as local time in any arbitrary timezone. It also
sets the date and time simultaneously, avoiding race conditions in command
scripts when used near midnight.
signal
sends OS/2 signals to processes.
sort
is an enhanced, 32-bit, replacement for OS/2's
16-bit sort
command. It can sort up to the size of available
virtual memory and has no 64KiB limit, can also sort files named on the
command line, and supports extended wildcards and the other standard CLU
features. It's also quicker!
strings
displays embedded strings of characters in files,
which is particularly useful for searching binary files for text strings.
It supports the standard CLU features of recursing into subdirectories,
including and excluding files by attribute, and extended wildcards.
sum
calculates CRC-16, CRC-32, two different types of
checksum (UNIX BSD and System V), and the MD5 fingerprint for files. It
supports the standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
tail
outputs the last few lines of its input, which can
either be a number of files specified on its command line or its standard
input. It supports the standard CLU features of recursing into
subdirectories, including/excluding files by attribute, and extended
wildcards.
tasklist
lists the contents of the PM Window List in text
form, suitable for parsing, or use from text-mode programs.
tee
is a "T-shaped" pipe fitting, that sends its
standard input to its standard output, writing or appending a copy of it to
one or more files named as its arguments.
textconv
converts text files from one code page and
newline convention to another. It makes it easy to interchange text files
between OS/2 and Usenet, the Macintosh, and UNIX/linux, or between OS/2 users
in different countries with different code pages. It supports code page 1004
in particular, in order that one can convert text files from other code pages
to ISO 8859 Latin-1.
tomorse
converts text files to Morse code suitable
for piping into the playmorse
command. It can be used as
part of a command pipeline, and supports the standard CLU features of
being able to recurse into subdirectories and include/exclude files by
attribute, and extended wildcards.
touch
changes the last modification, last access, or
creation timestamp of files and directories. It can override read-only
protection, and it supports the standard CLU features of being able to
recurse into subdirectories and include/exclude files by attribute, and
extended wildcards.
tree
is an enhanced 32-bit replacement for OS/2's
16-bit tree
command. Unlike the latter, this command
actually displays a tree! It can also display size information, and be
limited to using only ASCII characters instead of character graphics. It
also supports extended wildcards.
uniq
displays files, eliminating multiple occurrences of
the same line. It can operate either locally, only eliminating consecutive
duplicate lines, or globally, eliminating all duplicate lines; and supports
the standard CLU features of recursing into subdirectories,
including/excluding files by attribute, and extended wildcards.
unstamp
displays files, converting encoded timestamps of
the form used in log files, to human-readable form in the current - or an
arbitrary - timezone. It supports the standard CLU features of extended
wildcards, inclusion and exclusion of files by attributes, and recursion into
subdirectories.
w2kfix
alters IBM's Boot Managers in situ in such a way that
Microsoft's Windows NT 2000 no longer recognises and overwrites them each
time it is booted.
watchlog
monitors one or a suite of log files generated
by CYCLOG, writing all logged data to its standard output, suitable for
passing through a pipe to other commands (such as UNSTAMP).
wc
counts the number of lines, words, letters, characters,
and bytes in files. It supports the standard CLU features of recursing
into subdirectories, including/excluding files by attribute, and extended
wildcards.
weavesvc
weaves a tapestry of services, managed by
service managers, interconnecting them via pipes. The tapestry is
configurable. The Service Weaver allows services to be easily connected to
instances of CYCLOG to log their output to log files.
what
finds any embedded SCCS identifying strings in files.
which
finds out what would be executed if a given
command name were used. It knows about commands that are built into the
16-bit CMD
, 32-bit CMD
, and 4OS2
command interpreters, and obeys the PATHEXT
environment
variable.
winsight
displays the hierarchy of Presentation Manager
windows as a tree structure, showing window handles, parents, owners,
process and thread IDs, styles, IDs, types, and text.
xdel
deletes files. It supports the standard CLU
features of recursing into subdirectories, including/excluding files by
attribute, and extended wildcards. It can also remove empty
subdirectories, override read-only protection, and wipe the contents of
files before deleting them in order to prevent them from being
successfully undeleted.
xdir
displays directory listings. It supports the standard
CLU features of recursing into subdirectories, including/excluding
files by attribute, and extended wildcards. It can also sort files from
multiple subdirectories into one big list, allowing one to see all files
in multiple subdirectories sorted together by size for example, and has no
arbitrary limits on the number of files that it can process.
y
is a "Y-shaped" pipe fitting, that concatenates
its standard input with one or more files and sends the result to its
standard output. It can also be used as a more powerful replacement for
the type
command built into IBM's 16-bit CMD
command interpreter, since it supports the standard CLU features of
extended wildcards, inclusion and exclusion of files by attributes, and
recursion into subdirectories.
Commands new in version 2.1 of the Command Line Utilities that weren't in version 2.0:
cyclog
,dellname
,delthumb
,descedit
,dupdir
,head
,tomorse
,newmbr
,playmorse
,runsvc
,service
,setbootg
,signal
,tail
,uniq
,unstamp
,w2kfix
,watchlog
, andweavesvc
.
Commands new in version 2.0 of the Command Line Utilities that weren't in version 1.0:
anaclock
,arcdir
,bcomp
,calctz
,comp
,convcase
,cpuidg
,cpuidt
,deltree
,digclock
,dirsize
,find
,finddups
,fitsize
,help
,partlist
,playtune
,resetini
,saydate
,setdate
,sort
,strings
,sum
,tasklist
,tee
,textconv
,tree
,winsight
, andy
.
Commands in version 2.0 of the Command Line Utilities that were brought over from version 1.0:
attrib
,dump
,ff
,grep
,mem
,touch
,wc
,what
,which
,xdel
, andxdir