man pages section 1: User
Commands
Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054
U.S.A.
Part No: 816–0210–10
May 2002
Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved.
This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No
part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any.
Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.
Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S.
and other countries, exclusively licensed through X/Open Company, Ltd.
Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, and Solaris are trademarks, registered trademarks, or service marks
of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks
of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun
Microsystems, Inc.
The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the
pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a
non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs
and otherwise comply with Sun’s written license agreements.
Federal Acquisitions: Commercial Software–Government Users Subject to Standard License Terms and Conditions.
DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits réservés
Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la
décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans
l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative
aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun.
Des parties de ce produit pourront être dérivées du système Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux
Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd.
Sun, Sun Microsystems, le logo Sun, docs.sun.com, AnswerBook, AnswerBook2, et Solaris sont des marques de fabrique ou des marques déposées, ou
marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des
marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres pays. Les produits portant les marques
SPARC sont basés sur une architecture développée par Sun Microsystems, Inc.
L’interface d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît
les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie
de l’informatique. Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les
licenciés de Sun qui mettent en place l’interface d’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun.
CETTE PUBLICATION EST FOURNIE “EN L’ETAT” ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N’EST ACCORDEE, Y COMPRIS DES
GARANTIES CONCERNANT LA VALEUR MARCHANDE, L’APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION
PARTICULIERE, OU LE FAIT QU’ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE
S’APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU.
020313@3332
Contents
Preface 17
Introduction 23
Intro(1) 24
User Commands 27
acctcom(1) 28
adb(1) 31
addbib(1) 32
alias(1) 34
allocate(1) 37
amt(1) 39
answerbook2(1) 40
appcert(1) 41
apptrace(1) 48
apropos(1) 53
ar(1) 55
arch(1) 59
as(1) 60
asa(1) 64
at(1) 66
atq(1) 72
atrm(1) 73
audioconvert(1) 74
audioplay(1) 78
3
audiorecord(1) 80
auths(1) 83
awk(1) 85
banner(1) 90
basename(1) 91
basename(1B) 93
bc(1) 94
bdiff(1) 98
bfs(1) 99
biff(1B) 103
break(1) 104
cal(1) 106
calendar(1) 107
cancel(1) 109
cat(1) 111
cc(1B) 113
cd(1) 115
cdrw(1) 118
checknr(1) 124
chgrp(1) 125
chkey(1) 127
chmod(1) 129
chown(1) 135
chown(1B) 137
ckdate(1) 138
ckgid(1) 141
ckint(1) 143
ckitem(1) 145
ckkeywd(1) 148
ckpath(1) 150
ckrange(1) 153
ckstr(1) 156
cksum(1) 159
cktime(1) 161
ckuid(1) 163
ckyorn(1) 165
clear(1) 167
cmp(1) 168
4 man pages section 1: User Commands • May 2002
col(1) 170
comm(1) 172
command(1) 174
compress(1) 177
coproc(1F) 180
cp(1) 184
cpio(1) 188
cpp(1) 196
cputrack(1) 202
crle(1) 206
crontab(1) 216
crypt(1) 220
csh(1) 221
csplit(1) 247
ct(1C) 250
ctags(1) 252
cu(1C) 255
cut(1) 261
date(1) 264
dc(1) 268
deallocate(1) 272
deroff(1) 274
df(1B) 275
dhcpinfo(1) 276
diff(1) 278
diff3(1) 282
diffmk(1) 284
dircmp(1) 285
dis(1) 286
dispgid(1) 288
dispuid(1) 289
dos2unix(1) 290
download(1) 292
dpost(1) 294
du(1) 297
du(1B) 300
dump(1) 302
dumpcs(1) 305
Contents 5
echo(1) 306
echo(1B) 310
echo(1F) 311
ed(1) 312
edit(1) 324
egrep(1) 328
eject(1) 331
elfdump(1) 335
enable(1) 337
env(1) 339
eqn(1) 341
error(1) 346
ex(1) 350
exec(1) 359
exit(1) 361
expand(1) 363
exportfs(1B) 365
expr(1) 366
expr(1B) 369
exstr(1) 372
face(1) 376
factor(1) 377
fastboot(1B) 378
fdformat(1) 379
fgrep(1) 383
file(1) 385
file(1B) 387
filesync(1) 389
find(1) 396
finger(1) 403
fmlcut(1F) 406
fmlexpr(1F) 408
fmlgrep(1F) 410
fmli(1) 412
fmt(1) 415
fmtmsg(1) 416
fnattr(1) 421
fnbind(1) 424
6 man pages section 1: User Commands • May 2002
fnlist(1) 426
fnlookup(1) 428
fnrename(1) 429
fnsearch(1) 430
fnunbind(1) 436
fold(1) 437
from(1B) 439
ftp(1) 440
ftpcount(1) 451
ftpwho(1) 452
gcore(1) 453
gencat(1) 454
geniconvtbl(1) 457
genlayouttbl(1) 460
genmsg(1) 475
getconf(1) 481
getfacl(1) 486
getfrm(1F) 490
getitems(1F) 491
getopt(1) 492
getoptcvt(1) 494
getopts(1) 497
gettext(1) 503
gettxt(1) 505
glob(1) 507
gprof(1) 508
graph(1) 513
grep(1) 515
groups(1) 520
groups(1B) 521
grpck(1B) 522
hash(1) 523
head(1) 525
history(1) 527
hostid(1) 536
hostname(1) 537
iconv(1) 538
indicator(1F) 540
Contents 7
indxbib(1) 541
install(1B) 542
ipcrm(1) 544
ipcs(1) 545
isainfo(1) 549
isalist(1) 551
jobs(1) 552
join(1) 559
kbd(1) 562
kdestroy(1) 565
keylogin(1) 566
keylogout(1) 568
kill(1) 569
kinit(1) 573
klist(1) 578
kpasswd(1) 580
ksh(1) 581
ktutil(1) 630
last(1) 632
lastcomm(1) 634
ld(1) 636
ld(1B) 648
ldap(1) 649
ldapdelete(1) 653
ldaplist(1) 656
ldapmodify(1) 660
ldapmodrdn(1) 664
ldapsearch(1) 667
ldd(1) 672
ld.so.1(1) 677
let(1) 685
lex(1) 686
limit(1) 698
line(1) 702
lint(1B) 703
list_devices(1) 705
listusers(1) 707
llc2_autoconfig(1) 708
8 man pages section 1: User Commands • May 2002
llc2_config(1) 709
llc2_stats(1) 711
ln(1) 719
ln(1B) 722
loadkeys(1) 725
locale(1) 726
localedef(1) 729
logger(1) 733
logger(1B) 735
login(1) 737
logname(1) 744
logout(1) 745
look(1) 746
lookbib(1) 747
lorder(1) 748
lp(1) 749
lpc(1B) 755
lpq(1B) 759
lpr(1B) 761
lprm(1B) 765
lpstat(1) 767
lptest(1B) 771
ls(1) 772
ls(1B) 778
m4(1) 781
mach(1) 786
machid(1) 787
mail(1B) 789
mailcompat(1) 790
mailp(1) 791
mailq(1) 793
mailstats(1) 795
mailx(1) 797
make(1S) 818
man(1) 853
mconnect(1) 859
mcs(1) 860
mdb(1) 862
Contents 9
mesg(1) 903
message(1F) 904
mixerctl(1) 906
mkdir(1) 908
mkmsgs(1) 910
mkstr(1B) 912
more(1) 914
mp(1) 920
mpss.so.1(1) 926
msgfmt(1) 929
mt(1) 935
mv(1) 938
nawk(1) 941
nca(1) 962
ncab2clf(1) 964
ncakmod(1) 966
netscape(1) 967
newform(1) 972
newgrp(1) 975
news(1) 977
newtask(1) 978
nice(1) 980
nis+(1) 982
niscat(1) 997
nischgrp(1) 1000
nischmod(1) 1002
nischown(1) 1005
nischttl(1) 1007
nisdefaults(1) 1009
niserror(1) 1012
nisgrpadm(1) 1013
nisln(1) 1017
nisls(1) 1019
nismatch(1) 1021
nismkdir(1) 1024
nisopaccess(1) 1027
nispasswd(1) 1030
nisrm(1) 1034
10 man pages section 1: User Commands • May 2002
nisrmdir(1) 1036
nistbladm(1) 1038
nistest(1) 1044
nl(1) 1046
nm(1) 1049
nohup(1) 1054
nroff(1) 1058
od(1) 1061
on(1) 1067
optisa(1) 1069
pack(1) 1070
pagesize(1) 1073
pargs(1) 1074
passwd(1) 1076
paste(1) 1082
patch(1) 1085
pathchk(1) 1090
pathconv(1F) 1093
pax(1) 1095
perl(1) 1104
pfexec(1) 1111
pg(1) 1112
pgrep(1) 1117
pkginfo(1) 1121
pkgmk(1) 1123
pkgparam(1) 1126
pkgproto(1) 1128
pkgtrans(1) 1130
plimit(1) 1132
plot(1B) 1134
pmap(1) 1136
postdaisy(1) 1143
postdmd(1) 1145
postio(1) 1147
postmd(1) 1150
postplot(1) 1153
postprint(1) 1155
postreverse(1) 1157
Contents 11
posttek(1) 1159
ppgsz(1) 1161
pr(1) 1164
praliases(1) 1168
prctl(1) 1169
preap(1) 1172
prex(1) 1174
print(1) 1185
printenv(1B) 1186
printf(1) 1187
priocntl(1) 1192
proc(1) 1203
prof(1) 1206
profiles(1) 1210
projects(1) 1212
ps(1) 1213
ps(1B) 1222
pvs(1) 1225
pwd(1) 1228
ranlib(1) 1229
rcp(1) 1230
rdist(1) 1232
read(1) 1237
readfile(1F) 1240
readonly(1) 1241
refer(1) 1242
regcmp(1) 1244
regex(1F) 1246
reinit(1F) 1248
renice(1) 1249
reset(1F) 1252
rlogin(1) 1253
rm(1) 1256
rmformat(1) 1260
roffbib(1) 1268
roles(1) 1270
rpcgen(1) 1272
rpm2cpio(1) 1277
12 man pages section 1: User Commands • May 2002
rsh(1) 1278
run(1F) 1281
runat(1) 1283
rup(1) 1286
rup(1C) 1287
ruptime(1) 1288
rusage(1B) 1289
rusers(1) 1291
rwho(1) 1292
sag(1) 1293
sar(1) 1295
sccs(1) 1300
sccs-admin(1) 1310
sccs-cdc(1) 1314
sccs-comb(1) 1316
sccs-delta(1) 1318
sccs-get(1) 1321
sccs-help(1) 1327
sccs-prs(1) 1328
sccs-prt(1) 1332
sccs-rmdel(1) 1335
sccs-sact(1) 1336
sccs-sccsdiff(1) 1337
sccs-unget(1) 1338
sccs-val(1) 1339
scp(1) 1341
script(1) 1343
sdiff(1) 1344
sed(1) 1346
sed(1B) 1353
set(1) 1359
set(1F) 1364
setcolor(1F) 1366
setfacl(1) 1367
setpgrp(1) 1371
sftp(1) 1372
sh(1) 1375
shell(1F) 1393
Contents 13
shell_builtins(1) 1394
shift(1) 1398
shutdown(1B) 1399
size(1) 1400
sleep(1) 1402
smart2cfg(1) 1403
soelim(1) 1405
solregis(1) 1406
sort(1) 1409
sortbib(1) 1416
sotruss(1) 1418
spell(1) 1420
spline(1) 1423
split(1) 1424
srchtxt(1) 1426
ssh(1) 1429
ssh-add(1) 1439
ssh-agent(1) 1441
ssh-http-proxy-connect(1) 1443
ssh-keygen(1) 1445
ssh-socks5-proxy-connect(1) 1448
strchg(1) 1450
strings(1) 1453
strip(1) 1455
stty(1) 1457
stty(1B) 1465
sum(1) 1472
sum(1B) 1473
suspend(1) 1474
symorder(1) 1475
sysV-make(1) 1476
tabs(1) 1483
tail(1) 1487
talk(1) 1490
tar(1) 1493
tbl(1) 1504
tcopy(1) 1506
tee(1) 1507
14 man pages section 1: User Commands • May 2002
telnet(1) 1508
test(1) 1518
test(1B) 1526
test(1F) 1528
tftp(1) 1530
time(1) 1533
times(1) 1536
timex(1) 1537
tip(1) 1539
tnfdump(1) 1548
tnfxtract(1) 1553
touch(1) 1555
touch(1B) 1558
tplot(1) 1559
tput(1) 1560
tr(1) 1564
tr(1B) 1569
trap(1) 1570
troff(1) 1572
true(1) 1575
truss(1) 1576
tset(1B) 1583
tsort(1) 1588
tty(1) 1590
type(1) 1591
typeset(1) 1592
ucblinks(1B) 1594
ul(1) 1595
umask(1) 1596
uname(1) 1599
unifdef(1) 1602
uniq(1) 1604
units(1) 1606
unix2dos(1) 1608
uptime(1) 1610
users(1B) 1611
uucp(1C) 1612
uuencode(1C) 1616
Contents 15
uuglist(1C) 1618
uustat(1C) 1619
uuto(1C) 1623
uux(1C) 1626
vacation(1) 1630
vc(1) 1633
vgrind(1) 1637
vi(1) 1641
vipw(1B) 1651
volcancel(1) 1652
volcheck(1) 1653
volmissing(1) 1655
volrmmount(1) 1656
vsig(1F) 1658
w(1) 1659
wait(1) 1661
wc(1) 1664
what(1) 1666
whatis(1) 1667
whereis(1B) 1668
which(1) 1670
who(1) 1671
whoami(1B) 1674
whocalls(1) 1675
whois(1) 1676
write(1) 1677
xargs(1) 1680
xgettext(1) 1685
xstr(1) 1687
yacc(1) 1689
yes(1) 1693
ypcat(1) 1694
ypmatch(1) 1695
yppasswd(1) 1696
ypwhich(1) 1697
Index 1699
16 man pages section 1: User Commands • May 2002
Preface
Both novice users and those familar with the SunOS operating system can use online
man pages to obtain information about the system and its features. A man page is
intended to answer concisely the question “What does it do?” The man pages in
general comprise a reference manual. They are not intended to be a tutorial.
Overview
The following contains a brief description of each man page section and the
information it references:
■
Section 1 describes, in alphabetical order, commands available with the operating
system.
■
Section 1M describes, in alphabetical order, commands that are used chiefly for
system maintenance and administration purposes.
■
Section 2 describes all of the system calls. Most of these calls have one or more
error returns. An error condition is indicated by an otherwise impossible returned
value.
■
Section 3 describes functions found in various libraries, other than those functions
that directly invoke UNIX system primitives, which are described in Section 2.
■
Section 4 outlines the formats of various files. The C structure declarations for the
file formats are given where applicable.
■
Section 5 contains miscellaneous documentation such as character-set tables.
■
Section 6 contains available games and demos.
■
Section 7 describes various special files that refer to specific hardware peripherals
and device drivers. STREAMS software drivers, modules and the
STREAMS-generic set of system calls are also described.
17
■
Section 9 provides reference information needed to write device drivers in the
kernel environment. It describes two device driver interface specifications: the
Device Driver Interface (DDI) and the Driver⁄Kernel Interface (DKI).
■
Section 9E describes the DDI/DKI, DDI-only, and DKI-only entry-point routines a
developer can include in a device driver.
■
Section 9F describes the kernel functions available for use by device drivers.
■
Section 9S describes the data structures used by drivers to share information
between the driver and the kernel.
Below is a generic format for man pages. The man pages of each manual section
generally follow this order, but include only needed headings. For example, if there
are no bugs to report, there is no BUGS section. See the intro pages for more
information and detail about each section, and man(1) for more information about man
pages in general.
NAME This section gives the names of the commands or
functions documented, followed by a brief
description of what they do.
SYNOPSIS This section shows the syntax of commands or
functions. When a command or file does not exist
in the standard path, its full path name is shown.
Options and arguments are alphabetized, with
single letter arguments first, and options with
arguments next, unless a different argument order
is required.
The following special characters are used in this
section:
[ ] Brackets. The option or argument
enclosed in these brackets is optional. If
the brackets are omitted, the argument
must be specified.
. . . Ellipses. Several values can be provided
for the previous argument, or the
previous argument can be specified
multiple times, for example, "filename
".
| Separator. Only one of the arguments
separated by this character can be
specified at a time.
{ } Braces. The options and/or arguments
enclosed within braces are
interdependent, such that everything
enclosed must be treated as a unit.
18 man pages section 1: User Commands • May 2002
PROTOCOL This section occurs only in subsection 3R to
indicate the protocol description file.
DESCRIPTION This section defines the functionality and behavior
of the service. Thus it describes concisely what the
command does. It does not discuss OPTIONS or
cite EXAMPLES. Interactive commands,
subcommands, requests, macros, and functions are
described under USAGE.
IOCTL This section appears on pages in Section 7 only.
Only the device class that supplies appropriate
parameters to the ioctl(2) system call is called
ioctl and generates its own heading. ioctl calls
for a specific device are listed alphabetically (on the
man page for that specific device). ioctl calls are
used for a particular class of devices all of which
have an io ending, such as mtio(7I).
OPTIONS This secton lists the command options with a
concise summary of what each option does. The
options are listed literally and in the order they
appear in the SYNOPSIS section. Possible
arguments to options are discussed under the
option, and where appropriate, default values are
supplied.
OPERANDS This section lists the command operands and
describes how they affect the actions of the
command.
OUTPUT This section describes the output – standard output,
standard error, or output files – generated by the
command.
RETURN VALUES If the man page documents functions that return
values, this section lists these values and describes
the conditions under which they are returned. If a
function can return only constant values, such as 0
or –1, these values are listed in tagged paragraphs.
Otherwise, a single paragraph describes the return
values of each function. Functions declared void do
not return values, so they are not discussed in
RETURN VALUES.
ERRORS On failure, most functions place an error code in
the global variable errno indicating why they
failed. This section lists alphabetically all error
codes a function can generate and describes the
conditions that cause each error. When more than
Preface 19
one condition can cause the same error, each
condition is described in a separate paragraph
under the error code.
USAGE This section lists special rules, features, and
commands that require in-depth explanations. The
subsections listed here are used to explain built-in
functionality:
Commands
Modifiers
Variables
Expressions
Input Grammar
EXAMPLES This section provides examples of usage or of how
to use a command or function. Wherever possible a
complete example including command-line entry
and machine response is shown. Whenever an
example is given, the prompt is shown as
example%, or if the user must be superuser,
example#. Examples are followed by explanations,
variable substitution rules, or returned values. Most
examples illustrate concepts from the SYNOPSIS,
DESCRIPTION, OPTIONS, and USAGE sections.
ENVIRONMENT VARIABLES This section lists any environment variables that
the command or function affects, followed by a
brief description of the effect.
EXIT STATUS This section lists the values the command returns to
the calling program or shell and the conditions that
cause these values to be returned. Usually, zero is
returned for successful completion, and values
other than zero for various error conditions.
FILES This section lists all file names referred to by the
man page, files of interest, and files created or
required by commands. Each is followed by a
descriptive summary or explanation.
ATTRIBUTES This section lists characteristics of commands,
utilities, and device drivers by defining the
attribute type and its corresponding value. See
attributes(5) for more information.
SEE ALSO This section lists references to other man pages,
in-house documentation, and outside publications.
20 man pages section 1: User Commands • May 2002
DIAGNOSTICS This section lists diagnostic messages with a brief
explanation of the condition causing the error.
WARNINGS This section lists warnings about special conditions
which could seriously affect your working
conditions. This is not a list of diagnostics.
NOTES This section lists additional information that does
not belong anywhere else on the page. It takes the
form of an aside to the user, covering points of
special interest. Critical information is never
covered here.
BUGS This section describes known bugs and, wherever
possible, suggests workarounds.
Preface 21
22 man pages section 1: User Commands • May 2002
Introduction
23
Intro – introduction to commands and application programs
This section describes, in alphabetical order, commands available with this operating
system.
Pages of special interest are categorized as follows:
1B Commands found only in the SunOS/BSD Compatibility Package.
1C Commands for communicating with other systems.
1F Commands associated with Form and Menu Language Interpreter
(FMLI).
1S Commands specific to the SunOS system.
See these sections of the man pages section 1M: System Administration Commands for
more information.
■
Section 1M in this manual for system maintenance commands.
■
Section 4 of this manual for information on file formats.
■
Section 5 of this manual for descriptions of publicly available files and
miscellaneous information pages.
■
Section 6 in this manual for computer demonstrations.
For tutorial information about these commands and procedures, see:
■
Solaris Advanced User’s Guide
Unless otherwise noted, commands described in the SYNOPSIS section of a manual
page accept options and other arguments according to the following syntax and
should be interpreted as explained below.
name [-option ] [cmdarg ] where:
[ ] Surround an option or cmdarg that is not required.
Indicates multiple occurrences of the option or cmdarg.
name The name of an executable file.
{ } The options and/or arguments enclosed within braces are
interdependent, such that everything enclosed must be treated as a
unit.
option (Always preceded by a “−”.) noargletter or, argletter optarg[, ]
noargletter A single letter representing an option without an option-argument.
Note that more than one noargletter option can be grouped after
one “−” (Rule 5, below).
argletter A single letter representing an option requiring an
option-argument.
Intro(1)
NAME
DESCRIPTION
OTHER
SECTIONS
Manual Page
Command Syntax
24 man pages section 1: User Commands • Last Revised 1 Nov 1999
optarg An option-argument (character string) satisfying a preceding
argletter. Note that groups of optargs following an argletter must be
separated by commas, or separated by a tab or space character and
quoted (Rule 8, below).
cmdarg Path name (or other command argument) not beginning with “−”,
or “−” by itself indicating the standard input.
These command syntax rules are not followed by all current commands, but all new
commands will obey them. getopts(1) should be used by all shell procedures to
parse positional parameters and to check for legal options. It supports Rules 3-10
below. The enforcement of the other rules must be done by the command itself.
1. Command names (name above) must be between two and nine characters long.
2. Command names must include only lower-case letters and digits.
3. Option names (option above) must be one character long.
4. All options must be preceded by “−”.
5. Options with no arguments may be grouped after a single “−”.
6. The first option-argument (optarg above) following an option must be preceded by
a tab or space character.
7. Option-arguments cannot be optional.
8. Groups of option-arguments following an option must either be separated by
commas or separated by tab or space character and quoted (−o xxx,z,yy or − o
"xxx z yy").
9. All options must precede operands (cmdarg above) on the command line.
10. “−−” may be used to indicate the end of the options.
11. The order of the options relative to one another should not matter.
12. The relative order of the operands (cmdarg above) may affect their significance in
ways determined by the command with which they appear.
13. “−” preceded and followed by a space character should only be used to mean
standard input.
See attributes(5) for a discussion of the attributes listed in this section.
getopts(1), wait(1), exit(2), getopt(3C), wait(3UCB), attributes(5)
Upon termination, each command returns two bytes of status, one supplied by the
system and giving the cause for termination, and (in the case of “normal” termination)
one supplied by the program [see wait(3UCB) and exit(2)]. The former byte is 0 for
normal termination; the latter is customarily 0 for successful execution and non-zero
to indicate troubles such as erroneous parameters, or bad or inaccessible data. It is
called variously “exit code”, “exit status”,or“return code”, and is described only
where special conventions are involved.
Intro(1)
Command Syntax
Standard: Rules
ATTRIBUTES
SEE ALSO
DIAGNOSTICS
Introduction 25