i
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
201 West 103rd Street
Indianapolis, Indiana 46290
LINUX COMPLETE
Command Reference
For more information on the Linux operating system and
Red Hat Software, Inc., check
.
Compiled by J. Purcell
Red Hat Software, Inc.
President Richard K. Swadley
Publisher and Director of Acquisitions Jordan Gold
Director of Product Development Dean Miller
Managing Editor Kitty Wilson Jarrett
Indexing Manager Johnna L. VanHoose
Director of Marketing Kelli S. Spencer
Associate Product Marketing Manager Jennifer Pock
Marketing Coordinator Linda Beckwith
COPYRIGHT © 1997 BY RED HAT SOFTWARE, INC.
FIRST EDITION
All rights reserved. No part of this book shall be reproduced, stored in a retrieval
system, or transmitted by any means, electronic, mechanical, photocopying,
recording, or otherwise, without written permission from the publisher. No
patent liability is assumed with respect to the use of the information contained
herein. Although every precaution has been taken in the preparation of this
book, the publisher and author assume no responsibility for errors or omissions.
Neither is any liability assumed for damages resulting from the use of the
information contained herein. For information, address Sams Publishing, 201
Technical Reviewer
Bill Ball
Editorial Coordinators
Mandie Rowell
Katie Wise
Technical Edit Coordinator
Lynette Quinn
Editorial Assistants
Carol Ackerman
Andi Richter
Rhonda Tinch-Mize
Karen Williams
Cover Designer
Karen Ruggles
Book Designer
Ann Jones
Copy Writer
David Reichwein
Production Team Supervisor
Beth Lewis
Production Team
Erin Danielson, Bryan Flores,
DiMonique Ford, Julie Geeting,
Kay Hoskin, Christy M. Lemasters,
Tony McDonald, Darlena Murray,
Julie Searls, Sossity Smith
Overview
Part I
User Commands 2
Part II
atktopbm ............................................................................................................10
bash .................................................................................................................... 11
bdftopcf ..............................................................................................................47
beforelight........................................................................................................... 47
biff ......................................................................................................................48
bioradtopgm .......................................................................................................48
bitmap, bmtoa, atobm ........................................................................................ 49
bmptoppm .......................................................................................................... 57
brushtopbm ........................................................................................................57
cal ....................................................................................................................... 58
cat ....................................................................................................................... 58
chattr .................................................................................................................. 59
chfn .................................................................................................................... 60
chgrp...................................................................................................................61
chkdupexe ........................................................................................................... 61
chmod.................................................................................................................61
chown .................................................................................................................62
chsh .................................................................................................................... 63
ci .........................................................................................................................64
cidentd ................................................................................................................ 69
cksum ................................................................................................................. 70
clear ....................................................................................................................70
cmuwmtopbm .................................................................................................... 71
co ........................................................................................................................71
col .......................................................................................................................76
colcrt................................................................................................................... 77
colrm .................................................................................................................. 77
column................................................................................................................78
comm..................................................................................................................78
v
fmt .................................................................................................................... 143
fold ................................................................................................................... 143
free .................................................................................................................... 144
fsinfo ................................................................................................................. 145
fslsfonts ............................................................................................................. 145
fstobdf............................................................................................................... 146
fstopgm ............................................................................................................. 147
ftp ..................................................................................................................... 147
fuser ..................................................................................................................154
g++.................................................................................................................... 155
g3topbm ........................................................................................................... 160
gawk ................................................................................................................. 161
Linux Complete Command Reference
vi
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
gcal ................................................................................................................... 173
gcc, g++.............................................................................................................174
gemtopbm ........................................................................................................ 201
geqn .................................................................................................................. 202
getlist ................................................................................................................206
getopt................................................................................................................207
giftopnm ........................................................................................................... 208
gindxbib............................................................................................................ 209
glookbib ............................................................................................................210
gnroff ................................................................................................................210
gouldtoppm ...................................................................................................... 211
gpic ................................................................................................................... 211
gprof ................................................................................................................. 216
grefer.................................................................................................................217
grep, egrep, fgrep ..............................................................................................224
vii
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
ispell, buildhash, munchlist, findaffix, tryaffix, icombine, ijoin ......................... 274
join ................................................................................................................... 282
kill .................................................................................................................... 283
killall ................................................................................................................. 284
ksyms ................................................................................................................284
last .................................................................................................................... 285
lbxproxy ............................................................................................................ 286
ld ...................................................................................................................... 287
lispmtopgm ....................................................................................................... 292
lkbib ................................................................................................................. 292
ln ...................................................................................................................... 293
lndir .................................................................................................................. 294
locate ................................................................................................................ 295
logger ................................................................................................................295
login..................................................................................................................296
look................................................................................................................... 297
lpq .................................................................................................................... 298
lpr ..................................................................................................................... 299
lprm .................................................................................................................. 301
lptest ................................................................................................................. 302
ls, dir, vdir.........................................................................................................303
lsattr .................................................................................................................. 304
lsmod ................................................................................................................305
lynx ................................................................................................................... 306
macptopbm....................................................................................................... 309
make ................................................................................................................. 310
makedepend ...................................................................................................... 312
mtest .................................................................................................................330
mtools ............................................................................................................... 330
mtvtoppm ......................................................................................................... 333
mtype................................................................................................................333
mv .................................................................................................................... 334
mwrite ..............................................................................................................335
namei ................................................................................................................335
newaliases..........................................................................................................336
newgrp .............................................................................................................. 336
nl ......................................................................................................................337
nlmconv ............................................................................................................338
nm ....................................................................................................................339
nntpget ............................................................................................................. 340
objcopy .............................................................................................................341
objdump ........................................................................................................... 342
oclock ............................................................................................................... 344
od .....................................................................................................................345
passwd .............................................................................................................. 346
paste..................................................................................................................347
pbmclean ..........................................................................................................348
pbmfilters..........................................................................................................348
pbmlife .............................................................................................................352
pbmmake .......................................................................................................... 353
pbmmask ..........................................................................................................353
pbmpscale .........................................................................................................354
pbmreduce ........................................................................................................ 355
pbmtext ............................................................................................................355
pbmto10x .........................................................................................................356
pbmto4425 .......................................................................................................357
pbmtoascii ........................................................................................................ 357
pgmcrater .......................................................................................................... 370
pgmedge ........................................................................................................... 371
pgmenhance ......................................................................................................371
pgmhist ............................................................................................................. 372
pgmkernel ......................................................................................................... 372
pgmnoise .......................................................................................................... 373
pgmnorm .......................................................................................................... 373
pgmoil .............................................................................................................. 374
pgmramp .......................................................................................................... 374
pgmtexture ........................................................................................................ 375
pgmtofs ............................................................................................................. 376
pgmtolispm ....................................................................................................... 376
pgmtopbm ........................................................................................................ 377
pgmtoppm ........................................................................................................ 378
pi1toppm .......................................................................................................... 378
pi3topbm ..........................................................................................................379
picttoppm ......................................................................................................... 379
pjtoppm ............................................................................................................ 381
pktopbm ........................................................................................................... 381
pnmalias............................................................................................................ 381
pnmarith ........................................................................................................... 382
pnmcat.............................................................................................................. 383
pnmcomp ......................................................................................................... 383
pnmconvol ........................................................................................................384
Linux Complete Command Reference
x
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
pnmcrop ...........................................................................................................385
pnmcut .............................................................................................................385
pnmdepth ......................................................................................................... 385
ppmdither .........................................................................................................403
ppmflash ...........................................................................................................404
ppmforge ..........................................................................................................404
ppmhist.............................................................................................................408
ppmmake ..........................................................................................................408
ppmmix ............................................................................................................408
ppmnorm..........................................................................................................409
ppmntsc ............................................................................................................ 409
ppmpat .............................................................................................................410
ppmquant ......................................................................................................... 411
ppmquantall......................................................................................................412
ppmqvga ...........................................................................................................412
xi
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
ppmrelief .......................................................................................................... 413
ppmshift ........................................................................................................... 413
ppmspread ........................................................................................................ 414
ppmtoacad ........................................................................................................ 414
ppmtobmp ........................................................................................................416
ppmtogif ...........................................................................................................416
ppmtoicr ...........................................................................................................417
ppmtoilbm ........................................................................................................ 418
ppmtomap ........................................................................................................419
ppmtomitsu ...................................................................................................... 420
ppmtopcx.......................................................................................................... 421
ppmtopgm ........................................................................................................ 421
ppmtopi1 .......................................................................................................... 422
ppmtopict ......................................................................................................... 422
ppmtopj ............................................................................................................ 423
Linux Complete Command Reference
xii
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
reconfig .............................................................................................................454
ref .....................................................................................................................455
reset .................................................................................................................. 456
resize .................................................................................................................456
rev .....................................................................................................................457
rgb3toppm ........................................................................................................457
rlog ................................................................................................................... 458
rlogin ................................................................................................................ 460
rm .....................................................................................................................461
rmdir ................................................................................................................ 462
rmmod ..............................................................................................................462
rnews ................................................................................................................463
rpcgen ............................................................................................................... 464
rsh.....................................................................................................................466
rstart ................................................................................................................. 467
rstartd ............................................................................................................... 468
rup ....................................................................................................................472
rusers ................................................................................................................ 472
rwall .................................................................................................................. 473
rwho ................................................................................................................. 474
script ................................................................................................................. 474
sed .................................................................................................................... 475
sessreg ...............................................................................................................480
setterm .............................................................................................................. 482
sgitopnm ...........................................................................................................483
shar ...................................................................................................................484
shlock................................................................................................................487
tin, rtin, cdtin, tind ........................................................................................... 516
tload.................................................................................................................. 533
top ....................................................................................................................533
touch ................................................................................................................536
tr ....................................................................................................................... 536
tset, reset ........................................................................................................... 539
tsort .................................................................................................................. 542
twm .................................................................................................................. 542
txt2gcal .............................................................................................................558
ul ...................................................................................................................... 558
unexpand .......................................................................................................... 559
uniq ..................................................................................................................560
unshar ............................................................................................................... 560
updatedb ........................................................................................................... 561
uptime .............................................................................................................. 562
userlist............................................................................................................... 563
uucp.................................................................................................................. 563
uuencode .......................................................................................................... 565
uustat ................................................................................................................566
uux....................................................................................................................569
uuxqt ................................................................................................................572
w ....................................................................................................................... 573
wall ................................................................................................................... 574
wc ..................................................................................................................... 574
whereis .............................................................................................................. 575
write.................................................................................................................. 576
x11perf..............................................................................................................577
x11perfcomp ..................................................................................................... 585
xargs.................................................................................................................. 586
xauth ................................................................................................................. 587
xmkmf ..............................................................................................................672
xmodmap ..........................................................................................................672
xon....................................................................................................................676
xpmtoppm ........................................................................................................677
xprop ................................................................................................................677
xrdb ..................................................................................................................681
xrefresh .............................................................................................................684
Xserver .............................................................................................................. 685
xset....................................................................................................................690
xsetroot .............................................................................................................693
xsm ................................................................................................................... 694
xsmclient........................................................................................................... 698
xstdcmap...........................................................................................................699
xterm ................................................................................................................ 700
Xvfb .................................................................................................................. 717
xvidtune ............................................................................................................719
xvminitoppm ....................................................................................................720
xwd ................................................................................................................... 721
xwdtopnm ........................................................................................................ 722
xwininfo............................................................................................................722
xwud ................................................................................................................. 725
ybmtopbm ........................................................................................................726
ytalk .................................................................................................................. 727
yuvplittoppm .................................................................................................... 730
xv
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
yuvtoppm ......................................................................................................... 731
zcmp, zdiff ........................................................................................................731
zeisstopnm ........................................................................................................732
getdents ............................................................................................................ 759
getdomainname, setdomainname ...................................................................... 760
getdtablesize ......................................................................................................760
getgid, getegid ................................................................................................... 761
getgroups, setgroups .......................................................................................... 761
gethostid, sethostid ........................................................................................... 762
gethostname, sethostname ................................................................................. 763
getitimer, setitimer ............................................................................................763
getpagesize ........................................................................................................ 765
getpeername ......................................................................................................765
getpid, getppid ..................................................................................................766
getpriority, setpriority ....................................................................................... 766
Linux Complete Command Reference
xvi
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
getrlimit, getrusage, setrlimit ............................................................................. 767
getsid ................................................................................................................768
getsockname......................................................................................................769
getsockopt, setsockopt....................................................................................... 769
gettimeofday, settimeofday................................................................................ 772
getuid, geteuid ..................................................................................................773
idle ....................................................................................................................774
ioctl...................................................................................................................774
ioperm ..............................................................................................................788
iopl ................................................................................................................... 788
ipc .....................................................................................................................789
kill ....................................................................................................................790
killpg.................................................................................................................790
link ................................................................................................................... 791
listen ................................................................................................................. 792
xvii
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
read ................................................................................................................... 822
readdir .............................................................................................................. 823
readlink ............................................................................................................. 823
readv, writev......................................................................................................824
reboot ............................................................................................................... 825
recv, recvfrom, recvmsg ..................................................................................... 826
rename ..............................................................................................................828
rmdir ................................................................................................................ 829
sched_get_priority_max, sched_get_priority_min .............................................830
sched_rr_get_interval ........................................................................................ 831
sched_setparam, sched_getparam ...................................................................... 832
sched_setscheduler, sched_getscheduler ............................................................ 833
sched_yield ....................................................................................................... 835
select, FD_CLR, FD_ISSET, FD_SET, FD_ZERO......................................... 835
semctl................................................................................................................837
semget ............................................................................................................... 839
semop ............................................................................................................... 840
send, sendto, sendmsg ....................................................................................... 842
setfsgid .............................................................................................................. 843
setfsuid.............................................................................................................. 844
setgid ................................................................................................................ 845
setpgid, getpgid, setpgrp, getpgrp ...................................................................... 845
setregid, setegid .................................................................................................846
setreuid, seteuid ................................................................................................ 847
setsid ................................................................................................................. 848
setuid ................................................................................................................848
setup .................................................................................................................849
truncate, ftruncate .............................................................................................879
umask ............................................................................................................... 880
uname ...............................................................................................................880
none..................................................................................................................881
afs_syscall, break, gtty, lock, mpx, prof, quotactl, stty, ustat ..............................881
unlink ............................................................................................................... 882
uselib ................................................................................................................883
ustat .................................................................................................................. 883
utime, utimes ....................................................................................................884
vhangup ............................................................................................................885
vm86 ................................................................................................................ 885
wait, waitpid .....................................................................................................886
wait3, wait4 ...................................................................................................... 888
write..................................................................................................................889
Part III Library Functions
Intro ................................................................................................................. 892
abort .................................................................................................................892
abs .................................................................................................................... 892
acos ................................................................................................................... 893
acosh ................................................................................................................. 893
alloca.................................................................................................................894
asin ................................................................................................................... 894
asinh .................................................................................................................895
assert ................................................................................................................. 895
atan ................................................................................................................... 896
atan2 ................................................................................................................. 896
atanh .................................................................................................................897
atexit ................................................................................................................. 897
atof ................................................................................................................... 898
atoi....................................................................................................................898
erf, erfc.............................................................................................................. 914
execl, execlp, execle, exect, execv, execvp ........................................................... 914
errno ................................................................................................................. 916
exit .................................................................................................................... 917
exp, log, log10, pow .......................................................................................... 917
expm1, log1p .................................................................................................... 918
fabs ................................................................................................................... 919
fclose .................................................................................................................919
clearerr, feof, ferror, fileno................................................................................. 919
fflush, fpurge ..................................................................................................... 920
ffs ...................................................................................................................... 921
fgetgrent............................................................................................................ 921
fgetpwent .......................................................................................................... 922
floor .................................................................................................................. 923
fmod ................................................................................................................. 923
fnmatch ............................................................................................................ 924
fopen, fdopen, freopen ...................................................................................... 924
fpathconf, pathconf ........................................................................................... 925
fread, fwrite .......................................................................................................926
frexp..................................................................................................................927
fgetpos, fseek, fsetpos, ftell, rewind.................................................................... 927
ftime ................................................................................................................. 928
ftok ................................................................................................................... 929
ftw .................................................................................................................... 930
Linux Complete Command Reference
xx
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
gcvt ................................................................................................................... 930
getcwd, get_current_dir_name, getwd...............................................................931
getdirentries ......................................................................................................931
isatty ................................................................................................................. 958
isinf, isnan, finite .............................................................................................. 959
j0, j1, jn, y0, y1, yn ...........................................................................................959
killpg.................................................................................................................960
labs ................................................................................................................... 960
ldexp ................................................................................................................. 961
ldiv....................................................................................................................961
lgamma ............................................................................................................. 962
libinn ................................................................................................................962
libpbm .............................................................................................................. 966
libpgm ..............................................................................................................969
libpnm .............................................................................................................. 970
xxi
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
libppm .............................................................................................................. 973
localeconv ......................................................................................................... 974
longjmp ............................................................................................................ 975
lfind, lsearch...................................................................................................... 975
calloc, malloc, free, realloc................................................................................. 976
mblen................................................................................................................ 977
mbstowcs .......................................................................................................... 977
mbtowc ............................................................................................................. 978
memccpy .......................................................................................................... 978
memchr ............................................................................................................ 979
memcmp ........................................................................................................... 979
memcpy ............................................................................................................ 980
memfrob ........................................................................................................... 980
memmem.......................................................................................................... 981
memmove ......................................................................................................... 981
Linux Complete Command Reference
xxii
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
rewinddir ........................................................................................................1011
rint..................................................................................................................1011
rquota .............................................................................................................1012
scandir, alphasort ............................................................................................1012
scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf..................................................... 1013
seekdir.............................................................................................................1015
setbuf, setbuffer, setlinebuf, setvbuf.................................................................1016
setenv .............................................................................................................. 1017
setjmp ............................................................................................................. 1018
setlocale...........................................................................................................1018
siginterrupt ..................................................................................................... 1019
sigemptyset, sigfillset, sigaddset, sigdelset, sigismember ................................... 1019
sin ................................................................................................................... 1020
sinh ................................................................................................................. 1021
sleep ................................................................................................................1021
snprintf, vsnprintf ........................................................................................... 1022
sqrt..................................................................................................................1023
stdarg .............................................................................................................. 1023
stdio ................................................................................................................ 1025
stpcpy .............................................................................................................1027
strcasecmp, strncasecmp .................................................................................. 1028
strcat, strncat................................................................................................... 1028
strchr, strrchr .................................................................................................. 1029
strcmp, strncmp ..............................................................................................1029
strcoll .............................................................................................................. 1030
strcpy, strncpy ................................................................................................. 1030
strdup .............................................................................................................1031
cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, tcgetpgrp, tcsetpgrp.......... 1049
tmpfile ............................................................................................................1053
tmpnam .......................................................................................................... 1054
toascii..............................................................................................................1055
toupper, tolower..............................................................................................1055
tsearch, tfind, tdelete, twalk ............................................................................ 1056
ttyname ........................................................................................................... 1058
tzset ................................................................................................................ 1058
none................................................................................................................ 1060
usleep .............................................................................................................. 1061
wcstombs ........................................................................................................1061
wctomb ........................................................................................................... 1061
Part IV Special Files
charsets ........................................................................................................... 1064
console ............................................................................................................ 1066
console_codes ................................................................................................. 1067
console ioctls ................................................................................................... 1074
fd .................................................................................................................... 1080
hd ................................................................................................................... 1083
ispell ...............................................................................................................1084
lp .................................................................................................................... 1090
mem, kmem, port ...........................................................................................1091
mouse ............................................................................................................. 1092
null, zero ......................................................................................................... 1094
ram ................................................................................................................. 1094
sd .................................................................................................................... 1095
st ..................................................................................................................... 1096
tty ................................................................................................................... 1100
ttys .................................................................................................................. 1101
vcs, vcsa ..........................................................................................................1101
issue ................................................................................................................ 1146
lilo.conf...........................................................................................................1147
MAKEDEV.cfg ..............................................................................................1151
moderators ......................................................................................................1151
/etc/modules ...................................................................................................1152
motd ............................................................................................................... 1152
mtools ............................................................................................................. 1152
newsfeeds ........................................................................................................1158
newslog ...........................................................................................................1163
nfs ...................................................................................................................1165
nnrp.access ...................................................................................................... 1167
nntpsend.ctl .................................................................................................... 1168
nologin ........................................................................................................... 1168
overview.fmt ...................................................................................................1168
passwd ............................................................................................................1169
passwd.nntp ....................................................................................................1170
pbm ................................................................................................................ 1170
pgm ................................................................................................................ 1171
pnm ................................................................................................................ 1173
ppm ................................................................................................................ 1173
/proc ............................................................................................................... 1174
protocols .........................................................................................................1180
rcsfile .............................................................................................................. 1181
xxv
Introduction
gr11 Linux Complete Command Reference 31104-6 christy 11.6.97 FM lp3
resolver............................................................................................................ 1183
securetty .......................................................................................................... 1184
services ............................................................................................................ 1184
shells ...............................................................................................................1186
intro ................................................................................................................ 1258
adduser, addgroup........................................................................................... 1258
agetty ..............................................................................................................1259
archive ............................................................................................................ 1262
arp .................................................................................................................. 1263
badblocks ........................................................................................................ 1264
buffchan.......................................................................................................... 1264
cfdisk ..............................................................................................................1265
chat ................................................................................................................. 1269