home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
tail.zip
/
AIXLIKE.INF
(
.txt
)
next >
Wrap
OS/2 Help File
|
1994-07-13
|
52KB
|
1,792 lines
ΓòÉΓòÉΓòÉ 1. In General ΓòÉΓòÉΓòÉ
The programs in the AIXLIKE package are OS/2 implementations of the like-named
AIX version 3.1 shell commands. The command line syntax is supposed to be
identical to the AIX versions (with a couple of exceptions noted below), and
the output is supposed to be identical except in cases of operating system
dependent information.
Differences in the operation of the OS/2 and AIX versions of these utilities
should be limited to differences in the shells and differences in the
underlying OS. Here are some of the differences:
o Path seperator character. The OS/2 utilities accept only OS/2 style path
names.
o Ambiguous path names. The OS/2 versions do not accept ambiguous directory
names as part of paths. Instead, most of the programs support an -s switch,
which applies the utility recursively to subdirectories. For example,
wc -s *.c
counts lines, words and bytes for each file matching "*.c" in the current
working diretory and in each subdirectory below it.
o Quoted strings. None of the various quoting schemes implemented by the AIX
shells are supported. In particular,
- Escape sequences such as \n and \t are only weakly supported on the
command line. I've made an effort to interpret these correctly in sed.
- Quotes in the form `this is a quoted string' are not supported. Use double
quotes: "this is a supported quoted string".
- Single quotes are not supported. Use double quotes.
The programs in the AIXLIKE package have had quite a bit of testing, but you
can expect to find bugs in them, and there are probably places where my
understanding of the AIX versions is wrong or incomplete. Most of them have
been available on OS2TOOLS for a couple of years, and, based on my mail, have
had at least moderate use. The programs are in use on my desk, running under
OS/2 version 1.3, but they have not been extensively tested on versions 1.2 or
2.0. I will accept, and try to fix, all bug reports. I will also accept
reports of variance from 'spec'-that is, differences between the way these
programs run and the way their counterparts run on AIX 3.1. Bug reports and
other comments should go to AIXLIKE FORUM on the IBMPC conference disk.
Source is provided for all the code in the AIXLIKE package. To the best of my
knowledge, this code is 'clean': it is the product of my own work, done on my
own time, and is therefore wholly owned by IBM. (Exceptions to this are noted
below.) To the extent that my permission is required, I grant permission to any
employee of IBM to use or modify this code for IBM management-approved
purposes. I'd appreciate a note telling me what you did to it, though; and if
you find a way to speed up the grep matching routines, please, PLEASE, let me
know.
There are also versions of LEX and YACC (actually FLEX and BISON) on PCTOOLS.
They are in the YACC package owned by John Q. Walker. I've used them, and they
have worked well for me. They are not distributed with source. Brian Yoder has
a version of ls, as well as chmod, cd, and other programs in UTIL2 PACKAGE on
OS2TOOLS.
The version of df in this package was written by Peter J. Schwaller. I made
some trivial additions to it. If you find a bug, it's probably mine; if you
want to pat someone on the back, send mail to PJS at RALVMC.
The version of du in this package was written by Dierk Schueler. Likewise, the
code he gave me was of very high quality and I thank him for it.
The version of compress in this package is modified from public domain code.
You will have to get permission from legal to redistribute the compress code.
If anyone has other AIXLIKE utilities that they would like to share, I'll be
glad to include them in this package. I ask only that
1. You make the user interface as much as possible like the AIX version 3.1
counterpart.
2. You agree to fix bugs as time allows.
3. Your source is 'clean' and you agree to distribute it under the
restrictions I outlined above.
The program descriptions in the following chapters contain material taken from
AIX Commands Reference for IBM RISC System/6000. volumes 1 - 3.
ΓòÉΓòÉΓòÉ 2. The AIXLIKE Utilities ΓòÉΓòÉΓòÉ
ΓòÉΓòÉΓòÉ 2.1. at ΓòÉΓòÉΓòÉ
at -- Runs commands at a later time
Usage
at [-c | -k | -s] [-m] Time [Today | Date] [Increment] [-l | -r job]
The at command reads from standard input the names of commands to be run at a
later time and allows you to specify when the commands should be run.
The AIX at command mails you all output from standard output and standard error
for the scheduled commands, unless you redirect that output. It also writes
the job number and the scheduled time to standard error. The OS/2 version,
lacking an underlying mail system, puts the output in a directory called
\at\output. The jobs are listed by job number.
When the at command is executed, it retains the current process environment.
It does not retain open file descriptors, traps, and priority.
You can use the AIX at command if your name appears in the file
/usr/adm/cron/at.allow. If that file does not exist, the at command checks the
file /usr/adm/cron/at.deny to determine if you should be denied a ccess to the
at command. If neither file exists, only someone with root au thority can
submit a job. The allow/deny files contain one user name per lin e. If (the
at.allow file does exist, the root user's login nmae must be included in it for
that person to be able to use the command.) In the OS/2 version, everyone has
permission to use the at command
The required Time parameter can be one of the following:
1. A number followed by an optional suffix. The at command interprets one-
and two-digit numbers as hours. It interprets four digits as hours and
minutes. The NLTIME environment variable specifies the order of hours and
minutes. The default order is the hour followed by the minute. You
can also separate hour s and minutes with a : (colon). The default
order is Hour:Minute.
2. The at command also recognizes the following keywords as special Times:
noon, midnight, now, A for AM, P for PM, N for noon, and M for midnight.
Note that you can use the special word now only if you also specify a Date
or an Increment. Otherwise, the at command tells you: too late. The
NLTSTRS environment variable controls the additional keywords that the at
command recognizes.
You may specify the Date parameter as either a month name and a day number (and
possibly a year number preceded by a comma), or a day of the week. The NLDATE
environment variable specifies the order of the month name and day number (by
default, month followed by day). The NLLDAY environment variable specifies
long day names; NLSDAY and NLSMONTH specify short day and month names. (By
default, the long name is fully spelled out; the short name is appreviated to
two or more characters for weekdays, and three characters for months). The at
command recognizes two special "days", today and tomorrow by default. (The
NLSTRS environment variable specifies these special days.) today is the
default Date if the specified time is later than the current hour; tomorrow is
the default if the time is earlier than the current hour. If the specified
month is less than the current month (and a year is not given), next year is
the default year. The optional Increment can be one of the following:
1. A + (plus sign) followed by a number and one of the following words:
minute[s], hour[s], day[s], week[s], month[s], year[s] (or their
non-English equivalents).
2. The special word next followed by one of the following words: minute[s],
hour[s], day[s], week[s], month[s], year[s] (or their non-English
equivalents).
FLAGS
-c Requests that the csh command be used for executing this job. (Not
currently implemented in the OS2 version. CMD.EXE is the shell used
in all cases. This flag, as well as the -k and -s flags, are
accepted but not used.)
-k Requests that the ksh command be used for executing this job.
-l Reports your scheduled jobs
-m Mails a message to the user about the successful completion of the
command. (This flag is accepted but has no effect in the OS/2
version.)
-r Job Removes Jobs previously scheduled by the at or batch commands, where
job is the number assigned by the at or batch commands. In the AIX
at, if you do not have root user authority (see the su command), you
can only remove your own jobs. The atrm command is available to the
root user to remove jobs issued by other users or all jobs issued by
a specific user. The OS/2 version allows anyone to remove any job.
-s Requests the bsh command (Bourne shell) be used for executing this
job. (Not currently implemented in the OS/2 version.)
EXAMPLES
1. To schedule the command from the terminal, enter a command similar to one
of the following:
at 5 pm Friday uuclean
Ctrl-Z
Note: In the OS/2 at command, as well as in most of the other programs in
the AIXLIKE package, ctrl-D is not supported as a termination signal. In
the case of the OS/2 at command, ctrl-Z is required to indicate the end of
input.
at now next week uuclean
Ctrl-Z
at now + 2 days uuclean
Ctrl-Z
at now + 2 days
uuclean
Ctrl-Z
2. To run the uuclean command at 3:00 in the afternoon on the 24th of January,
enter any one of the following commands:
echo uuclean | at 3:00 pm January 24
echo uuclean | at 3pm Jan 24
echo uuclean | at 1500 jan 24
3. To have a job reschedule itself, invoke the at command from within the
shell by including code similar to the following within the command file:
echo "cmdfile" | at now tomorrow
4. To list the jobs you have sent to be run later, enter:
at -l
5. To cancel a job, enter:
at -r 63567720.026
This cancels job 63567720.026. Use the at -l command to list the job
numbers assigned to your jobs.
OS/2 SPECIFICS
The OS/2 implementation has two programs: at.exe and atd.exe. The first is
loaded each time you invoke the at command. The second is a daemon that is
invoked by the at command (if it is not already loaded) and remains loaded
until there is no more scheduled work. li.For the at command to work correctly
after a system restart, you must load atd.exe during the startup procedure.
(If there is no scheduled work, it quietly goes away.) A good way to do this
is to put the line
atd
in your STARTUP.CMD file. (Add a path if necessary).
The daemon, atd, has an associated icon. Put the icon file (atd.ico in the
same directory as atd, or in a directory on your DPATH.
The at function creates (if they don't already exist), three directories. By
default, the directories are
C:\at -- usually empty except for its subdirectories
C:\at\jobs -- where queued jobs are stored
C:\at\output -- where the output of executed jobs is stored
You have control over the directory names. Use the ATJOBS environment variable
to select the directory in which queued jobs are stored. Output will be stored
in a parallel directory named output.
Output will accumulate in the at\out subdirectory. Periodically (perhaps as
scheduled by at itself) you should clean it out.
ΓòÉΓòÉΓòÉ 2.2. atob, btoa ΓòÉΓòÉΓòÉ
btoa: converts a binary file to an ascii format suitable for mailing.
atob: restores the original binary file
Both these programs are filters. They read from stdin and write to stdout. To
use them, redirect the output as required. For example, to create a mailable
ascii file from the file prog.exe, do something like
btoa <prog.exe >progexe.asc
To restore the original binary file, do something like
atob <progexe.asc >prog.exe
btoa encoding is more efficient, but less common than uuencoding (see uuencode
below). btoa encoding results in a file that is approximately 25% larger than
the source binary file (usually slightly less than 25%; sometimes slightly
more). uuencoding results in a file that is 33% larger than the original
binary file. Nevertheless, if you want to make sure the receiver can decode the
material you send, you are better off uuencoding.
ΓòÉΓòÉΓòÉ 2.3. compress, uncompress, or zcat ΓòÉΓòÉΓòÉ
compress: compress and expand data
Syntax
compress [-d -f -v -c -b Bits] Name [Name...
uncompress [-f -c -v] Name [Name...
zcat Name [Name...
The compress command reduces the size of the named files using adaptive
Lempel-Ziv coding. Whenever possible, each file is replaced by one with the
extension .Z while keeping the same ownership modes, access and modification
times. Compressed files can be restored to their original form using the
uncompress or zcat command.
The compress command uses the modified Lempel-Ziv algorithm popularized in A
Technique for High Performance Data Compression, Terry A. Welch, IEEE Computer,
Vo. 17, no. 6 (June, 1984), pp. 8-19.
The amount of compression obtained depends on the size of the input, the number
of Bits per code, and the distribution of common substrings.
Flags
-d Causes the compress command to uncompress Name.
-f Forces compression of Name even if it does not actually shrink or the
corresponding Name file already exists. If -f is not given, the user
is prompted as to whether an existing Name file should be
overwritten.
-c Makes the compress or uncompress command write to the standard
output; no files are changed. The non-destructive behavior of the
acat command is identical to that of the uncompress -c command.
-b Bits Specified the maximum number of Bits to use to replace common
substrings in the file. The default for Bits is 16, with values of 9
through 16 acceptable. First, the algorithm uses 9-bit codes 2257
thru 512. Then it uses 10-bit codes, continuing until the limit
specified by the -b flag is reached. The -b flag is not permitted
with the uncompress command.
After the Bits limit is attaned, the compress command periodically
checks the compression ratio. If it is increasing, the compress
command continues to use the existing code dictionary. However, if
the compression ratio decreases, the compress command discards the
table of substrings and rebuilds it from scratch. This allows the
algorithm to adapt to the next block of the file.
-v Causes the percentage reduction of each file to print.
The logic for all three commands is in module compress.exe. If you want to have
OS/2 versions of uncompress and zcat, simply copy compress.exe to
uncompress.exe (on HPFS) or uncompre.exe (on FAT); and to zcat.exe.
ΓòÉΓòÉΓòÉ 2.4. df ΓòÉΓòÉΓòÉ
df: Reports information about space on file systems
Usage
df [-l|-M|-i|-s|-v[ ]FileSystem FileSystem... | File File...]
\ / \ /
\ / \ /
\..one of../ \................one of............/
The df command displays information about total space and available space on a
file system. The FileSystem parameter specified the name of the device on
which the file system resides (the drive letter, under OS/2); in UNIX it can
also be the relative path name of a file system. If you do not specify the
FileSystem parameter, the df command displays information for all mounted file
systems. If a file or directory is specified, then the df command displays
information for the file system on which the file resides.
If the file system is being actively modified when the df command is run, the
free count may not be accurate.
The FileSystem specifications, if given, must be in the form
d:
where d is the drive letter on which the file system is mounted.
The File specifications, if given, are relative to the current working
directory.
Flags
-i Specified that the number of free and used i-nodes for the file
system is displayed; this is the default when the specified file
system is mounted. This flag is accepted but ignored for OS/2.
-l Specified that information on total K bytes, used space, free space,
percentage of used space, and mount point for the file system is
displayed.
-M Specifies that the mount point information for the file system is
displayed in the second column.
-s Specifies a full search of the free block list. This flag is
accepted but ignored for OS/2.
-v Specifies that all information for the specified file system is
displayed. Same as -l.
ΓòÉΓòÉΓòÉ 2.5. du ΓòÉΓòÉΓòÉ
du -- summarizes disk usage.
Syntax:
du [-lrs] [-a] [-b] File or Directory ...
The du command displays the number of bytes for all files and directories
specified by the File and Directory parameters, and recursively, for all
directories within the specified Directory Parameter. By specifying the -a
flag, you can also have the du command report the number of bytes in individual
files. The byte count includes all space allocated for the file (including
unused space), and will usually be a larger number than is shown by the OS/2
dir command.
The AIX implementation reports space in 1024-byte blocks. The OS/2 version
reports bytes unless you specify the -b flag, which forces reporting to
1024-byte blocks. Not that many devices have an allocation unit smaller than
1024, however, so rounding errors may occur, and a list of modules may not add
up to the correct total of blocks.
NOTES:
1. If the -a flag is not specified, the du command does not report on any
individual files.
FLAGS:
-a Displays disk use for each file
-b (OS/2 only) displays usage in 1024-byte blocks. If this flag is not
used, usage is displayed in bytes.
-l Allocates blocks evenly over links. Has no effect under OS/2.
-r Indicates inaccessible files and directories.
-s Displays only the total sum (for each of the specified files or
directories given).
EXAMPLES:
1. To summarize the disk usage of a directory tree and each of its subtrees,
enter
du \u\fran
This displays the number of bytes in the \u\fran directory and each of its
subdirectories.
2. To display the disk usage of each file, enter:
du -a \u\fran
This displays the bytes contained in each file and subdirectory of the
\u\fran directory. The number beside a directory is the disk usage of that
directory tree. The number beside a regular file is the disk usage of that
file alone.
3. To display only the total disk usage of a directory tree, enter:
du -rs \u\fran
This displays only the sum total disk usage of the \u\fran directory and
the files it contains. Specify the -s flag. The -r flag tells the du
command to display an error message if it cannot read a file or directory.
ΓòÉΓòÉΓòÉ 2.6. fgrep ΓòÉΓòÉΓòÉ
fgrep -- searches a file for a pattern.
Usage:
fgrep [-v][-x][-h][-s][-i] [-c | -l] [-b | -n]
[Pattern | -e Pattern | -f StringFile] File [File...
The fgrep command searches the input files specified by the File parameter
(standard input by default) for lines matching a pattern. The fgrep command
searches specifically for Pattern parameters that are fixed strings. The fgrep
command displays the name of the file containing the matched line if you
specify more than one file in the File parameter. The exit values of this
command are:
0 A match was found
1 No match was found
2 A syntax error was found or a file was inaccessible (even if matches were
found).
Flags:
-b Precedes each line by the block number on which it was
found. Use this flag to help find disk block numbers by
context. (In this implementation the relative
allocation unit number is shown);
-c Displays only a count of matching lines.
-e Pattern Specifies a pattern. This works the same as a simple
pattern, but is useful when a pattern begins with a -.
-f StringFile Specifies a file that contains strings to be matched.
(The file may specify up to 256 strings in this OS/2
implementation).
-h Suppresses file names when multiple files are being
processed.
-i Ignores the case of lettters when making comparisons.
-l Lists just the names of files (once) with matching
lines. Each file name is separated by a new-line
character.
-n Precedes each line with its relative line number in the
file.
-s Search all subdirectories below the specified path
(OS/2 only). NOTE: in the AIX implementation, the -s
switch indicates that no search results should be
printed and that only error messages should be
displayed. For consistancy, I have chosen to override
this not-all-that-useful switch.
-v Displays all lines except those that match the
specified pattern.
-x Displays lines that match the pattern exactly with no
additional characters.
-y Ignore case of letters when making comparisons
ΓòÉΓòÉΓòÉ 2.7. find ΓòÉΓòÉΓòÉ
find -- finds files with a matching expression.
The find command recursively searches the directory tree for each specified
path seeking files that match a Boolean Expression written using the terms
given below. The output from the find command depends on the terms used in
Expression.
find Path [Path ...] Expression
Note: In the following descriptions, the parameter Number is a decimal integer
that can be specified as +Number (more than Number), -Number (less than
Number), or Number (exactly Number).
-fstype Type True if the file system to which the file belongs
is of the type Type, where Type is jfs (journaled
file system) or nfs (networked file system).
In OS/2, ALWAYS TRUE.
-inum Number True if the i-node is Number. In OS/2, ALWAYS
TRUE.
-name FileName True if FileName matches the file name. You can
use pattern-matching characters, provided they are
quoted.
-perm OctalNumber In OS/2, ALWAYS TRUE.
-prune In OS/2, ALWAYS TRUE.
-type Type True if the file Type is of the specified type, as
follows:
b Block special file (In OS/2, ALWAYS FALSE)
c Character file (In OS/2, ALWAYS FLASE)
d Directory
f Plain file
p FIFO (a named pipe)
l Symbolic link (In OS/2, ALWAYS FALSE)
s Socket
-links Number True if the file has Number links. In OS/2, ALWAYS
FALSE.
-user UserName True if the file belongs to user UserName. In OS/2,
ALWAYS TRUE.
-group GroupName True if the file belongs to group GroupName. In
OS/2, ALWAYS TRUE.
-nogroup True if the file belongs to no groups. In OS/2,
ALWAYS TRUE.
-size Number True if the file is Number blocks long (512 bytes
per block). For this comparision, the file size is
rounded up to the next higher block.
-atime Number True if the file has been accessed in Number days.
-mtime Number True if the file has been modified in Number days.
-ctime Number True if the file has beeen changed in Number days.
-exec Command True if the Command runs and returns 0. The end of
Command must be punctuated by a quoted or escaped
semicolon. A command parameter of {} is replaced
by the current path name.
-ok Command The find command asks you whether it should start
Command. If your response begins with Y (upper or
lower case), Command is started. The end of
Command must be punctuated by a quoted or escaped
semicolon.
-print Always true; causes the current path name to be
displayed. The find command does not display path
names unless you specify this expression term.
-cpio Device Write the current file to Device in the cpio
command format. Always fails in OS/2.
-newer File True if the current file has been modified more
recently than the file indicated by File.
-\( Expression \) True if the expression in parentheses is true.
-depth Always true. Supposed to cause the descent of the
directory hierarchy to be done so that all entries
in a directory are affected before the directory
itself. This can be useful when the find commdna
is used with the cpio command to transfer files
that are contained in directories without write
permission.
Does nothing at all in OS/2.
-ls Always true; prints more path information.
-xdev Always true; no effect in OS/2.
-o logical or. (Juxtaposition of two terms without -o
implies a logical and.)
! Negation of an expression term
ΓòÉΓòÉΓòÉ 2.8. grep ΓòÉΓòÉΓòÉ
grep -- searches a file for a pattern.
Usage:
grep [-i][-w][-y][-q][-s][v][-pSeperator [-c | -l] [-b | -n]
[Pattern | -e Pattern | File [File...
The grep command searches for the pattern specified by the Pattern parameter
and writes each matching line to standard output. The patterns are limited
regular expressions in the style of the ed command.
The grep command displays the name of the file containing the matched line if
you specify more than one name in the File parameter. Characters with special
meaning to the OS2 shell must be quoted when they appear in the Pattern
parameter. When the Pattern parameter is not a simple string, you usually must
enclose the entire pattern in double quotation marks. In an expression such as
[a-z], the minus means through according to the current collating sequence. A
collating sequence may define equivalence classes for use in the character
ranges. The exit values of this command are:
0 A match was found
1 No match was found
2 A syntax error was found or a file was inaccessible (even if matches were
found).
Notes:
1. Lines are limited to 512 characters; longer lines are broken into multiple
lines of 512 or fewer characters.
2. Paragraphs (under the -p flag) are currently limited to a length of 5000
characters.
Flags:
-b Precedes each line by the block number on which it was
found. Use this flag to help find disk block numbers by
context. (In this implementation the relative allocation
unit number is shown);
-c Displays only a count of matching lines.
-e Pattern Specifies a pattern. This works the same as a simple
pattern, but is useful when a pattern begins with a -.
-i Ignores the case of lettters when making comparisons.
-l Lists just the names of files (once) with matching lines.
Each file name is separated by a new-line character.
-n Precedes each line with its relative line number in the
file.
-pSeperator Displays the entire paragraph containing matched lines.
Paragraphs are delimited by paragraph seperators, as
specified by the Seperator parameter, which is a pattern in
the same form as the search pattern. Lines containing the
paragrphs seperators are used only as seperators; they are
never included in the output. The default paragraph
seperator is a blank line.
-q Suppresses error messages about files that are not
accessible.
-s Search all subdirectories below the specified path. NOTE:
in the AIX implementation, the -s switch indicates that no
search results should be printed and that only error
messages should be displayed. For consistancy, I have
chosen to override this not-all-that-useful switch.
-v Displays all lines except those that match the specified
pattern.
-w Does a word search.
-y Ignore case of letters when making comparisons
This OS/2 implementation is slower than Ralph Yozzo's implementation available
in the GREP package on PCTOOLS. If you have a lot of grepping to do, you might
want to use Ralph's. On the other hand, this implementation retains the
traditional behavior of the utility, and may act more like you expect. This
version also supports ed-type general expressions, including subpatterns and
recursion operators, which Ralph's does not.
ΓòÉΓòÉΓòÉ 2.9. head ΓòÉΓòÉΓòÉ
Head -- displays the first few lines of a file or files.
Usage
head [-Count] [File [File ...
where
Count Specifies the number of lines of each of the specified files to
be displayed.
File Specifies 0 or more file specs. The default in stdin.
ΓòÉΓòÉΓòÉ 2.10. kill ΓòÉΓòÉΓòÉ
Kill -- sends a signal to a running process
Usage
kill [-l] or [-Signal] pid
or
kill 0 or -1
The kill command sends a signal (by default, the KillProcess signal) to a
running process which you specify by process ID (pid). This default action
normally stops processes that ignore or do not catch the signal. The OS/2
command PSTAT reports process IDs. You can also use the AIXLIKE ps command to
find the process ID number of commands.
If you are not a root user, you must own the process you want to stop. When
operating as a root user, you can stop any process. In OS/2 you are always the
root user.
Flags
0 In AIX, sends the signal to all processes having a PID
equal to the PID of the sender (except those with PIDs 0
and 1). In OS/2 it does nothing at all.
-1 In Aix, sends the signal to all processes with a PID
equal to the effective user ID of the sender (except to 0
and 1). In OS/2 it does nothing at all.
ProcessID Sends the signal to all processes whose process-group
number is equal to the absolute value of the ProcessID
-l Lists supported signal names and numbers:
KillProcess
SIGBREAK
SIGINTR
SIGUSER1
SIGUSER2
SIGUSER3
-Signal The signal can be the signal number or the signal name.
NOTE: This has not been well-exercised on OS/2 version 2.0. I suspect it may
have problems.
ΓòÉΓòÉΓòÉ 2.11. more ΓòÉΓòÉΓòÉ
more or page -- Displays continuous text one screen at a time on a display
screen.
Usage
more -cdflsu -n +Number File [File ...
or or
page +/Pattern
The more command displays continuous text one screen at a time. It pauses after
each screen adn prints the word More at the bottom of the screen. If (you then
press a carriage return, the more command displays an additional line. If you
press the space bar, the more command displays another screen of text. NOTE:
The OS/2 version does not support differences between the 'page' and 'more'
commands. If you want a 'page', just rename 'more'.
Only attached OS/2 displays have been tested. You may have trouble with an
attached ascii terminal or with telnet. If you do, please report it.
Flags:
-c Keeps the screen from scrolling and makes it easier to read text
while the more command is writing to the terminal. The -c flag is
ignored if the terminal does not have the ability to clear to the
end of a line.
Under OS/2, this option is much faster than the scrolling case.
-d Prompts the user to continue, quit, or obtain help.
-f Causes the more command to count logical lines, rather than screen
lines. The -f flag is recommended if the nroff command is being
piped through the ul command.
-l Does not treat control-L (form feed) in a special manner. If the -l
flag is not supplied, the more command pauses after any line that
contains a control-L, as though a full screen of text has been
reached. If a file begins with a form feed, the screen is cleared
before the file is printed.
-n (Where n is an integer) specified the number of lines in the
window. If the -n flag is specified, the more command does not use
the default number.
-s Squeezes multiple blank lines from the output to produce only one
blank line. The -s flag is particularly helpful when viewing
output from the nroff command. This flag maximizes the useful
information present on the screen.
Not implemented for OS/2 yet.
-u Suppresses the more command from underlining or creating stand-out
mode for underlined information in a source file.
+Number Starts at the specified line Number.
+/Pattern Starts two lines before the line containint the regular expression
Pattern.
In AIX, the more command uses the file /etc/terminfo to determine terminal
characteristics and to determine the default window size; in OS/2, I haven't
figured out how to do it yet, except in the locally attached case. On a
terminal capable of displaying 24 lines, the default window size is 22 lines.
If the more command is reading from a file rather than a pipe, it displays a
percent sign (%) with the more command prompt. This provides the fraction of
the file (in characters, not lines) that the more command has read. The page
command is equivalent to the more command.
Command Sequences:
Other command sequences that can be entered when the more command
pauses are as follows ( | is an optional integer option, defaulting
to 1):
|<space> Displays / more lines (or another screen full of text if no option
is given).
ctrl-D Displays 11 more lines (a "scroll"). If i is given, the scroll
size is set to i/. Same as d.
d Displays 11 more lines (a "Scroll"). Same as ctrl-D.
.|z Same as typing a space except that if | is present, it becomes the
new window size.
|s Skips | lines and prints a full screen of lines.
|f Skips | screens and prints a full screen of lines
|b Skips back I screens and prints a full screen of lines
|ctrl-B Skips back / screens and prints a full screen of lines.
q or Q Exits from more command.
= Displays the current line number
v Invokes vi editor <Not implemented in OS/2 version >
h This is the help command. Provides a description for all the more
commands.
|/expr Searches for the |-th occurance of the regular expression
Expression. If there are less than | occurances of Expression/,
and the input is a file (rather than a pipe), the position in the
file remains unchanged. Otherwise, a full screen is displayed,
starting two lines prior to the location of the expression.
|n Searches for the |th occurance of the last regular expression
entered. Goes to the point from which the last search started. If
a search has not been performed in the current file, this sequence
causes the more command to go to the beginning of the file.
!command Invokes a shell. The characters '%' and '!' in the command
sequence replaced with the current file name and the previous shell
command respectively. If there is no current file name, '%' is not
expanded. The sequences "\%" and "\!" are replaced by"%" and "!"
respectively.
i:n Skips to the I/th next file given in the command line. If n is not
valid, skips to the last file.
.i:p Skips to the I/th previous file given in the command line. If this
sequence is entered while the more command is in the middle of
printing a file, the more command goes back to the beginning of the
file.
:f Displays the current file name and line number.
:q or :Q Exits (same as q or Q).
. (dot) Repeats the previous command.
When any of the command sequences are entered, they begin to process
immediately. It is not necessary to type a carriage return.
The more command sets terminals to Noecho mode. This enables the output to be
continuous and only displays the / and ! commanda on your terminal as your
type. If the standard output is not a terminal, the more command processes
like the cat command. However, it prints a header before each file (if there
is more than one file).
NOTE: This has not been well-exercised on OS/2 version 2.0. I suspect it may
have problems.
Implementation Notes
o I've decided to set a maximum number of files at 64. I won't even try to
process more than that.
o I'm going to use VIO for video output.
ΓòÉΓòÉΓòÉ 2.12. printenv ΓòÉΓòÉΓòÉ
printenv -- Displays the values of the variables in the environment.
Syntax
prinvent [name [name ...
The printenv command displays the values of the variables in the environment.
If a Name is specified, only its value is printed. If a Name is not specified,
the printenv command displays the current environment, one Name=Value per line.
If a Name is specified and it is not defined in the environment, the printenv
command returns exit status 1, else it returns status 0.
ΓòÉΓòÉΓòÉ 2.13. ps ΓòÉΓòÉΓòÉ
The OS/2 process model is so different, it's amazing that you get anything at
all when you enter ps. What you do see has no relation whatever to what you
get from the AIX version.
You can put anything on the command line. Anything but -? or -help will be
ignored.
The following fields are displayed:
Heading Content
PID Process ID
PPID Parent's Process ID
SID Session ID
MHNDL Module handle
THRDS Number of threads
MODS Number of module entries
SEMS Number of System Semaphores
SSEG Number of Shared Segments
COMMAND 'Name' field from def file
The ps command will fail with a version check message on OS/2 version 2. There
is a new API, Dos32QuerySysStat, in version 2.0 that appears to provide the
same kinds of information as the old, undocumented DosQProcStat call in version
1.x, but I haven't figured out how to use it yet.
ΓòÉΓòÉΓòÉ 2.14. pwd ΓòÉΓòÉΓòÉ
pwd -- Displays the path name of the working directory.
Syntax:
pwd
The pwd command writes to standard output the full path name of your current
directory (from the root directory <of the current drive>. All directories are
seperated by a < \ (backslash>. <The current drive is represented first,
followed by a colon, then> the root directory. The last directory name is your
current directory.
ΓòÉΓòÉΓòÉ 2.15. rm ΓòÉΓòÉΓòÉ
rm -- Deletes file objects.
Usage:
rm [-f][-i][-r][-] File [File ...
Flags
-f instructs program to delete even those modules that are READONLY.
-i prompt user before deleting each file. When used in conjunction with
the -r switch, the user is also prompted as each subdirectory is dived
into.
-r recursive. Delete all subdirectories below the indicated file object.
BE VERY CAREFUL WITH THIS! You have been warned.
- consider everything following to be a file name. Not very useful in an
OS/2 environment, where file names can't start with '-', but we retain
it for conformity.
ΓòÉΓòÉΓòÉ 2.16. sed ΓòÉΓòÉΓòÉ
sed -- provides a stream editor
Syntax:
sed [-n] [-e Script] [-f SourceFile] File
| | |
| | |
----------------------------
|
0 or more of each
Description:
The sed command modifies lines from the specified File according to an edit
script and writes them to standard output. The sed command includes many
features for selecting lines to be modified and making changes only to the
selected lines.
The sed command uses two work spaces for holding the line being modified: the
pattern space, where the selected line is held; and the hold space, where a
line can be stored temporarily.
An edit script consists of individual subcommands, each one on a seperate line.
The general form of sed subcommands is the following:
[address-range] function [modifiers]
The sed command processes each input File by reading an input line into a
pattern space, applying all sed subcommands in sequence whose addresses select
that line, and writing the pattern space to standard output. It then clears the
pattern space and repeats this process for each line in the input File. Some
of the subcommands use a hold space to save all or part of the pattern space
for subsequent retrieval.
When a command includes an address (either a line number or a search pattern),
only the addressed line or lines are affected by the command. Otherwise, the
command is applied to all lines.
An address is either a decimal line number, a $ (dollar sign), which addresses
the last line of input, or a context address. A context address is a regular
expression similar to those used in ed except for the following differences:
o You can select the character delimiter for patterns. The general form of
the expression is
?pattern?
where ? is a character delimiter you select. The default form for the
pattern is /pattern/.
o The \n sequence matches a new-line character in the pattern space, except
the terminating new line.
o A dot (.) matches any character except a terminating new-line character.
That is, unlike ed, which cannot match a new-line character in the middle
of a line, sed can match a new-line character in the pattern space.
Certain commands allow you to specify one line or a range of lines to which the
command should be applied. These commands are called addressed commands. The
following rules apply to addresses commands:
o A command line with no address selects every line.
o A command line with one address, expressed in context form, selects each
line that matches the address.
o A command line with two addresses separated by commas selects the entire
range from the first line that matches the first address to next line that
matches the second. If the second address is a number less than or equal
to the line number first selected, only one line is selected. Thereafter,
the process is repeated, looking again for the first address.
NOTES:
1. The Text parameter accompanying the a\, c\ and i\ commands can continue
onto more than one line provided all lines but the last end with a \ to
quote the new-line character. Back slashes in text are treated like back
slashes in the replacement string of an s command, and can be used to
protect initial blanks and tabs against the stripping that is done on every
script line. The RFile and WFile parameters must end the command line and
must be preceded by exactly one blank. Each WFile is created before
processing begins.
2. The sed command can process up to 99 commands in a pattern file.
Flags
-e Script Uses the Script string as the editing script. If you are
using just one -e flag and no -f flag, the -e can be omitted.
-f SourceFile Uses SourceFile as the source of the edit script. SourceFile
is a prepared set of editing commands to be applied to Fi le.
-n Suppresses all information normally written to standard
output.
Commands (the number of allowable arguments, in parentheses, is shown preceding
the command).
(1)a\nText Places Text on the output before reading the next
input line. The script syntax is a\<new line
character>Text.
(2)b[label] Branches to the : command bearing the label. If
label is the null string, it brances to the end
of the script.
(2)c\nText Deletes the pattern space; with 0 or 1 addresses,
or at the end of a 2-address range, places Text
on the output. Then it starts the next cycle.
The script syntax is c\<new line character>Text.
(2)d Deletes the pattern space. Then it starts the
next cycle.
(2)D Deletes the initial segment of the pattern space
through the first new-line character. Then it
starts the next cycle.
(2)g Replaces the contents of the pattern space with
the contents of the hold space.
(2)G Appends the contents of the hold space to the
pattern space.
(2)h Replaces the contents of the hold space with the
contents of the pattern space.
(2)H Appends the contents of the pattern space to the
hold space.
(1)i\nText Writes Text to standard output before reading the
next line into the pattern space. The script
syntax is i\<new line character>Text.
(2)l Writes the patttern space to standard output
showing non-displayable characters as 2- or
4-digit hex values. Long lines are folded.
(2)n Writes the pattern space to standard output. It
replaces the pattern space with the next line of
input.
(2)N Appends the next line of input to the pattern
space with an embedded new-line character (the
current line number changes). You can use this
to search for patterns that are split onto two
lines.
(2)p Writes the pattern space to standard output.
(2)P Writes the initial segment of the pattern space
through the first new line character to standard
output.
(1)q Branches to the end of the script. It does not
start a new cycle.
(2)r RFile reads the contents of RFile. It places contents
on the output before reading the next input line.
(2)s/pattern/replacement/flags Substitutes replacement string for the first
occurance of the pattern in the pattern space.
Any character be substituted the / delimiter.
You can add zero or more of the following flags:
g Substitutes all nonoverlapping instances of the pattern parameter,
rather than just the first one.
p Writes the pattern psace to standard out if a replacement was made.
w WFile Writes the pattern pace to WFile if a replacement was made. Appends
the pattern space to WFile. If (WFile was not already created by a
previous write by this sed script, sed creates it.
NOTE: in the replacement string, the unescaped
character '&' stands for the text matched by the
pattern string.
(2)t label Branches to :label in the script file if any
substitutions were made since the most recent
reading of an input line or execution of a t
subcommand. If you do not specify label, control
transfers to the end of the script.
(2)w WFile Appends the pattern space to WFile.
(2)x Exchanges the contents of the pattern space and
the hold space.
(2)y/pattern1/pattern2/ Replaces all occurances of characters in pattern1
with the corresponding pattern2 characters. They
byte lengths of pattern1 and pattern2 must be
equal.
(2)! sed-cmd Applies the subcomand only to lines NOT selected
by the address or adresses.
(0):label This script entry simply marks a branch point to
be referenced by the b and t commands. This
label can be any sequence of 8 or fewer bytes
(actually, in this implementation it can be any
length).
(1)= Writes the current line number of standard output
as a line.
(2){subcmd ... ...} Groups subcommands enclosed in {} (braces).
ΓòÉΓòÉΓòÉ 2.17. sleep ΓòÉΓòÉΓòÉ
Suspends execution for an interval.
Usage:
sleep Seconds
The sleep command suspends execution of a process for the interval specified by
Seconds. Seconds can range from 1 to 32767.
To interupt the sleep command, press ctl+break.
ΓòÉΓòÉΓòÉ 2.18. split ΓòÉΓòÉΓòÉ
split - splits a file into pieces
SYNTAX
split -Number File Prefix Prefix
where
-Number gives the number of lines to each piece of the output file set.
It defaults to 1000 lines.
File is the name of the file to be split
Prefix is the leading part of the output file name. It defaults to 'x'.
DESCRIPTION
The split command reads the specified file and writes it in Number-line pieces
(default 1000 lines) to a set of output files. The name of the first output
file is constructed by combining the specified prefix (x by default) with aa,
the second by combining the prefix with ab, and so on lexicongraphically,
through zz (a maximum of 676 files). You cannot specify a Prefix longer than 12
characters.
For OS2, we check the first output file name. If it is illegal for the file
system, we exit.
ΓòÉΓòÉΓòÉ 2.19. strings ΓòÉΓòÉΓòÉ
strings - finds printable ascii strings in a binary file
Usage
strings [-] [-a] [-o] [-number] file
The strings command looks for ascii strings in a binary file. A string is any
sequence of 4 or more printing characters ending with a newline or a null. The
strings command is useful for identifying random object files.
Flags
-a or - Searches the entire file, not just data section, for ascii strings.
(This is always done in OS/2).
-o Lists each string preceded by its offset in the file (in octal).
-number Specified minimum string length rather than 4.
Examples
1. Searching a file
strings strings
outputs
!This program cannot be run in Dos mode.
m~Cj
DOSCALLS
splits stdin and so on.
2. Searches for strings at least 12 characters long
strings -12 strings
3. Searches for strings at least 20 characters long and also show s offset in
file.
strings -o -20 /usr/bin/strings
outputs
115 !This program cannot be run in DOS mode.
21105 strings: Could not open input file %s
21164 strings: finds printable strings in object or binary file
21260 Usage: strings [-] [-a] [-o] [-number] file and so on.
ΓòÉΓòÉΓòÉ 2.20. tail ΓòÉΓòÉΓòÉ
Writes a file to standard output, beginning at a specified point.
Usage
head [+/-Number[suffix] [-fr] [File [File ...
where
+/-Number indicates the starting point. If Number is introduced by
+, then the starting point is Number units from the
beginning of the file. If Number is introduced by - then
the starting point is Number units from the end of the
file. Default is -10
suffix is one of l, b, c or k. If l (the default), 'units' is
lines. If b, then 'units' is 512-byte blocks. If k,
then 'units' is 1024-byte blocks. If c, then 'units' is
characters.
-f Specifies that tail not end after copying the input file,
but rather check at 1-second intervals for more input.
Thus, it can be used to monitor the growth of a file
being written by another process.
-r Displays lines from the end of the file in reverse order.
The default for the -r option is print the entire file in
reverse order.
The tail command writes the named File (standard input by default) to standard
output, beginning at the point you specify. It begins reading at +Number lines
from the beginning of File or -Number lines from the end of File. The default
Number is 10. Number is counted in units of lines, block, or characters,
according to the subflag appearing after Number. The block size is either 512
bytes or 1k bytes.
Examples.
1. To display the last 10 lines of a file:
tail notes
2. To specify how far from the end to start:
tail -20 notes
3. To specify how far from the beginning to start:
tail +200c notes
This displays notes starting with the 200th character from the beginning.
4. To follow the growth of a file:
tail -1 -f accounts
This displays the last line of accounts. Once every second, the tail
command displays any lines that have been added to the file. This continues
until stopped by ctl+Break.
ΓòÉΓòÉΓòÉ 2.21. tee ΓòÉΓòÉΓòÉ
tee - read from stdin, write to stdout and one or more other files
Usage
tee [-a][-i] File [File ...
The tee command reads standard input and writes the output of a program to
standard output and copies it into the specified file or files at the same
time.
Flags
-a Adds the output to the end of File instead of writing over it.
-i Ignores interupts. (This flag is accepted in the OS/2 version , but
has no effect.)
The flags have to be specified separately: -i and -a but not -ia.
Implementation notes: this version handles up to 100 output files.
ΓòÉΓòÉΓòÉ 2.22. timex ΓòÉΓòÉΓòÉ
timex -- reports elapsed time for a command.
Usage:
timex [-o] [-s] [-p] Command
The timex command reports, in seconds, the elapsed time for a command. In AIX
it does lots of other neat things, too, but those neat things are not supported
by OS/2. For compatibility, I support the same flags, but they don't do
anything:
-o Reports total number of blocks read or written and total characters
transferred by a command and its children.
-p Lists process accounting records for a command, and all its children.
-s Reports total system activity during the execution of the command.
ΓòÉΓòÉΓòÉ 2.23. touch ΓòÉΓòÉΓòÉ
touch -- updates the access and modification times of a file.
Usage:
touch [-a | -m] [-c] [-f] [s] [time] Directory|File Directory|File ...
time is in the format MMDDHHmmyy, where
MM is the month number (required)
DD is the day number (required)
HH is the hour based on a 24-hour clock (required)
mm is the minute (required if yy is specified (defaults to 0))
yy is the last 2 digits of the year (optional, defaults to current year)
The touch command updates the access and modification times of each File or
Directory names to the one specified on the command line. If you do not
specify Time, the touch command uses the current time. If you specify a file
that does not exist, the touch command creates a file with that name unless you
request otherwise with the -c flag.
The format of the data and time are specified in the config.sys.
The return code from the touch command is the number of files for which the
times could not be successfully modified (including files that did not exist
and were not created).
Flags:
-a Changes only the access time.
-c Does not create the file if it already exists
-f Attempts to force the touch in spite of read and write permissions on a
file.
-m Changes only the modification time.
-s Apply changes to all matching files in subtrees (OS/2 only)
ΓòÉΓòÉΓòÉ 2.24. tr ΓòÉΓòÉΓòÉ
Translates characters.
Syntax:
tr [-A -c -Ac -cs -s] [-B] String1 String2
| |
-----one of-------
or
tr [-d -cd] [-B] String1
| |
-one of-
Description:
The tr command copies characters form the standard input to the standard output
with substitution or deletion of selected characters. Input characters from
string1 are replaced with the corresponding characters from String2. The tr
command cannot handle an ASCII NUL (\000) in String1 or String2; it always
deletes NUL from the input.
For compatibility with BSD, the OS/2 version has the -B flag to force BSD
semantics on the command line. The discussion below describes 'AIX' semantics
and 'BSD' semantics as described in the AIX commands reference.
In the AIX version abbreviations that can be used to introduce ranges of
characters or repeated characters are as follows:
[a-z] Stands for a string of characters whose ASCII codes run from
characters a to character z, inclusive.
[a*num] Stands for the number of repetitions of a. The num variable is
considered to be in decimal unless the first digit of num is 0;
then it is considered to be in octal.
In the BSD version, the abbreviation that can be used to introduce ranges of
characters is:
a-z Stands for a string of characters whose ASCII codes run from
character a to character z, inclusive. Note that brackets are not
special characters and the hyphen is.
Use the escape character \ (backslash) to remove special meaning from any
character in a string. Use the \ folllowed by 1, 2 or 3 octal digits for (the
ascii code of a character.
Flags:
-A Translates on a byte-by-byte basis. The OS/2 version always translates
on a byte-by-byte basis.
-B Forces BSD semantics for String1 and String2.
-c Indicates that the characters (1-255 decimal) *not* in String1 are to
be replaced by the characters in string 2.
-d Deletes all input characters in String1.
-s If the translated characters are consecutively repeated in the output
stream, output only one character.
Examples
1. To translate braces into parentheses:
tr '{}' '()' <textfile >outfile
This translates each { to ( and each } to ). All other characters remain
unchanged.
2. To translate lowercase characters to uppercase:
tr '[a-z]' '[A-Z]' <textfile >outfile
or
tr -B a-z A-Z <textfile >outfile
3. In the AIX version, this is what happens if the strings are not the same
length:
tr '[0-9]' '#' <textfile >outfile
This translates each 0 to a # (number sign).
Note: if the two character strings are not the same length, then the extra
characters in the longer one are ignored. :enote.
4. In the BSD version, if the strings are not the same length:
tr -B 0-9 # <textfile >outfile
This translates each digit to a #.
Note: If String2 is too short, it is padded to the length of String1 by
duplicating its last character. :enote.
5. In the AIX version, to translate each digit to a #:
tr '[0-9]' '[#*]' <textfile >outfile
The * tells tr to repeat the # enough times to make the second string as
long as the first one.
6. To translate each string of digits to a single #:
tr -s '[0-9]' '[#*]' <textfile >outfile
or
tr -Bs 0-9 # <textfile >outfile
7. To translate all ASCII characters that are not specified:
tr -c '[ -~]' '[A-_]?' <textfile >outfile
This translates each nonprinting ASCII characters to the corresponding
control key letter (/001 translates to "A", /002 to "B", etc.) ASCII DEL
(/177), the character that follows ~ (tilde), translates to ?.
Or with the BSD version:
tr -Bc ' -~' 'A-_?' <textfile >outfile
8. To create a list of the words in a file:
tr -cs '[a-z][A-Z]' '[\012*]' <textfile >outfile
or
tr -Bcs a-z A-z '\012' <textfile >outfile
This translates each string of nonalphabetic characters to a single
new-line character. The result is a list of all the words in textfile, one
word per line.
ΓòÉΓòÉΓòÉ 2.25. uniq ΓòÉΓòÉΓòÉ
uniq -- Deletes repeated lines in a file.
Usage
uniq [-c][-d][-u] [-Number [+Number] ...] InFile OutFile
\ /
one of these
The uniq command reads standard input or the InFile parameter, compares
adjacent lines, removes the second and succeeding occurances of a line, and
writes to standard output or the file specified by the OutFile parameter. The
InFile and OutFile parameters should always be different files. Repeated lines
must be on consecutive lines to be found. You can arrange them with the sort
command before processing.
FLAGS
-c Precedes each output line with a count of the number of times each
line appears in the file. This flag supersedes -d and -u.
-d Displays only the repeated lines.
-u Displays only the unrepeated lines.
-Number Skips over the first Number fields. A field is a string of
non-space, non-tab characters separated by tabs and/or spaces from
adjacent data on the same line.
+Number Skips over the first Number characters. Fields specified by the
Number parameter are skipped before characters.
ΓòÉΓòÉΓòÉ 2.26. uudecode ΓòÉΓòÉΓòÉ
Decodes a file that has been encoded using the uuencode program (q.v.).
Usage:
uudecode filename
where
filename is a valid path and name of the file containing the encoding. If
filename is not specified, input is taken from stdin.
uudecode reads the input file until it finds a valid 'begin' line. That line
has the format
begin rrr file-name
where
begin is a constant, beginning in line 1.
rrr is 3 octal permissions, usually 666. These are ignored in the
OS/2 version of uudecode.
file-name is the name of the unencoded file to be created.
uudecode creates file-name, decodes and writes out the file. It stops when it
gets to a null line (see uuencode).
EXAMPLE
uudecode mailfile
The file mailfile is read until a valid begin line is found, subsequent lines
are treated as uuencoded data, until a null line is found.
ΓòÉΓòÉΓòÉ 2.27. uuencode ΓòÉΓòÉΓòÉ
Encodes a file.
Syntax
uuencode [SourceFile] RemoteDestination
where
SourceFile is the name of the data file to be encoded. If it is
not specified, input is taken from stdin.
RemoteDestination is the name under which the uudecode program (q.v.)
will decode file.
uuencode creates a file containing a 'begin' line (described under uudecode
above), containing the permissions and the name with which the encoded data is
to be created on decoding. Then it encodes each byte of the input file. The
encoding algorithm outputs characters in the range 32 to 96 (decimal). These
characters normally survive mailers and other programs that sometimes transform
characters.
EXAMPLES
uuencode my.fil out.nam
The file my.fil is read and encoded. The string 'out.nam' is put in the
'begin' record, and when uudecode decodes the file, it will create a file named
out.nam.
uuencode bin.fil
Stdin is read and encoded. On decoding, the file will be created as bin.fil.
ΓòÉΓòÉΓòÉ 2.28. wc ΓòÉΓòÉΓòÉ
wc -- counts lines, words and characters
The wc command counts the number of lines, words, or characters in File or in
the standard input if you do not specify any Files. The command writes The
results to standard output and keeps a total count for all named files. A word
is defined as a string of characters delimted by spaces, tabs, or new-line
characters. By default, the wc command counts lines, words, and characters (as
bytes).
Usage:
wc [-c]||[-cl]||[-cw]||[-cwl]||[-l]||[-lw]||[-w]||[-k] {File ...
Flags:
-c Count bytes.
-l Count lines.
-w Count words.
-k Count actual characters, not bytes. Specifying the -k flag is
equivalent to specifying -kclw.
-s (OS2 only). Specifies that Files matching the pattern are searched for
in subdirectories of the specified directory.
The order of the -c, -w and -l flags is significant. It determines the order
of the columns. Default is "lines" "words" "characters".
ΓòÉΓòÉΓòÉ 2.29. which ΓòÉΓòÉΓòÉ
Finds the path of the program or programs named on the command line, showing
*which* copy would have been executed if the program name had been given on a
command line.
DOES NOT DO ALIASes. There is no standard OS/2 way of doing aliases.
It does expand wild cards.
All command names are searched for if an extension is not specified. First exe
then cmd.
Instead of using the path in .cshrc, as the AIX version does, this version uses
the environment variable PATH.
Syntax
which file [file [file...