home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / minix / 5085 / man1.Z / man1
Encoding:
Text File  |  1993-01-07  |  86.8 KB  |  2,518 lines

  1. echo x - animals
  2. sed '/^X/s///' > animals << '/'
  3. X.CD "animals \(en twenty-questions type guessing game about animals"
  4. X.SX "animals\fR [\fIdatabase\fR]"
  5. X.FL "\fR(none)"
  6. X.EY "animals" "Start the game"
  7. X.PP
  8. X\fIAnimals\fR is a guessing game.  The user picks an animal and the 
  9. Xcomputer tries to guess it by posing questions that should be answered by 
  10. Xtyping \*(OQy\*(CQ for yes and \*(OQn\*(CQ for no.  
  11. XWhenever the computer loses, it asks 
  12. Xsome questions that allow it to improve its database, so as time goes on, it 
  13. Xlearns.  The default database should be in \fI/usr/lib/animals\fR.
  14. X
  15. X
  16. X
  17. X.SP 0.3
  18. /
  19. echo x - anm
  20. sed '/^X/s///' > anm << '/'
  21. X.CD "anm \(en print name list [68000]"
  22. X.SX "anm \fR[\fB\(engnoprus\fR] \fIfile\fR ..."
  23. X.FL "\(eng" "Global symbols only"
  24. X.FL "\(enn" "Sort numerically"
  25. X.FL "\(eno" "Prepend the filename to each line"
  26. X.FL "\(enp" "No sorting\(emuse symbol table order"
  27. X.FL "\(enr" "Sort in reverse order"
  28. X.FL "\(enu" "List undefined symbols only"
  29. X.FL "\(ens" "Sort in section order"
  30. X.EY "anm  \(engn  test.o" "Print global symbols in numerical order"
  31. X.PP
  32. X.I Anm
  33. Xprints the name list (symbol table) of each ACK format object
  34. X.I file
  35. Xin the argument list.
  36. XIf no file name is given, \fIa.out\fR is used.
  37. XEach symbol name is preceded by its value, a section indicator
  38. Xand a type indicator.
  39. XThe section indicators are:
  40. X.SP 0.7
  41. X.HS
  42. X.ta 0.25i 0.50i
  43. X.nf
  44. X    \fBU\fR    Undefined symbol
  45. X    \fBA\fR    Absolute symbol
  46. X    \fB\(en\fR    Other symbol
  47. X.sp
  48. XThe type indicators are:
  49. X.HS
  50. X    \fBF\fR    Filename
  51. X    \fBM\fR    Module name
  52. X    \fBS\fR    Section name
  53. X    \fBE\fR    External (global) symbol
  54. X    \fB\(en\fR    Local symbol
  55. X.fi
  56. X.PP
  57. XThe output is sorted alphabetically, unless otherwise specified.
  58. XNotice that \fIanm\fR can only be used on ACK format object files 
  59. X(that is: \fI.o\fR and \fI.out\fR files). 
  60. XIf you want to get the name list of an executable program use 
  61. X.I nm
  62. Xinstead.
  63. X
  64. X
  65. X
  66. /
  67. echo x - aoutdump
  68. sed '/^X/s///' > aoutdump << '/'
  69. X.CD "aoutdump \(en display the contents of an object file [68000]"
  70. X.SX "aoutdump \fR[\fIfile\fR [\fIabcdef\fR] ]"
  71. X.FL "\fR(none)"
  72. X.EY "aoutdump test.o 000010" "dump the symbol table records of \fItest.o\fR"
  73. X.PP
  74. X.I Aoutdump
  75. Xgives a complete dump of each ACK formatted object
  76. X.I file
  77. Xin the argument list.
  78. XIf no
  79. X.I file
  80. Xis given, \fIa.out\fR is displayed.
  81. XThe parameter following the file name is a bit map that
  82. Xcan be used to specify a partial dump.
  83. XEach bit must be 0 or 1.
  84. XThe 6 bits in the map have the following meanings:
  85. X.HS
  86. X.ta 0.25i 0.50i
  87. X.nf
  88. X    \fIa\fR    Display the header record
  89. X    \fIb\fR    Display the section records
  90. X    \fIc\fR    Display the code bytes
  91. X    \fId\fR    Display the relocation records
  92. X    \fIe\fR    Display the symbol table records
  93. X    \fIf\fR    Display the string area
  94. X.fi
  95. X
  96. X
  97. X
  98. X.SP 1.5
  99. /
  100. echo x - ar
  101. sed '/^X/s///' > ar << '/'
  102. X.CD "ar \(en archiver"
  103. X.SX "ar\fR [\fBdmpqrtx\fR][\fBabciluv\fR]\fR [\fIposname\fR] \fIarchive \fIfile ..."
  104. X.FL "\fR(none)"
  105. X.EX "ar r libc.a sort.s" "Replace \fIsort\fR.s in \fIlibc.a\fR"
  106. X.EX "ar rb a.s libc.a b.s" "Insert \fIb.s\fR before \fIa.s\fR in \fIlibc.a\fR"
  107. X.PP
  108. X\fIAr\fR allows groups of files to be put together into a single archive.
  109. XIt is normally used for libraries of compiled procedures.  The following keys
  110. Xare allowed:
  111. X.HS
  112. X.ta 0.25i 0.50i
  113. X.nf
  114. X    \fBd\fR:    Delete. \fIAr\fR will delete the named members.
  115. X    \fBm\fR:    Move named files. \fIAr\fR expects \fIa\fR, \fIb\fR, or \fIi\fR to be specified.
  116. X    \fBp\fR:    Print the named files (list them on \fIstdout\fR)
  117. X    \fBq\fR:    Quickly append to the end of the archive file.
  118. X    \fBr\fR:    Replace (append when not in archive).
  119. X    \fBt\fR:    Print the archive's table of contents.
  120. X    \fBx\fR:    Extract
  121. X.fi
  122. X.HS
  123. X\fBThe keys may optionally concatencated with one or more of the following\fR:
  124. X.nf
  125. X.HS
  126. X    \fBa\fR:    After \fIposname\fR
  127. X    \fBb\fR:    Before \fIposname\fR
  128. X    \fBc\fR:    Create  (suppresses creation message)
  129. X    \fBi\fR:    Before \fIposname\fR
  130. X    \fBl\fR:    Local temporary file for work instead of \fI/tmp/ar.$$$$$\fR
  131. X    \fBu\fR:    Replace only if dated later than member in archive
  132. X    \fBv\fR:    Verbose
  133. X.HS
  134. X.fi
  135. X
  136. X
  137. X
  138. /
  139. echo x - as
  140. sed '/^X/s///' > as << '/'
  141. X.CD "as \(en MC68000 assembler [68000]"
  142. X.SX "as [\(ens][\(enu][\(enT\fIdir\fP][\(eno \fIname\fR] \fIfile\fR ..."
  143. X.FL "\(ens" "Strip symbol table"
  144. X.FL "\(enu" "Accept undefined symbols as external references"
  145. X.FL "\(enT" "Make temporary files in \fIdir\fP"
  146. X.FL "\(eno" "Put output on file named by next arg"
  147. X.EY "as \(enu \(eno file.o file.s" "assemble file.s into file.o"
  148. X.PP
  149. X.I As
  150. Xaccepts MC68000 instruction in a format like:
  151. X.I "move.l 4(a0),\(en(sp)" .
  152. XSee some of the source files, like
  153. X.I kernel/stmpx.s
  154. Xand
  155. X.I lib/sthead.s
  156. Xto get a feel for the syntax. The assembler supports a variable
  157. Xnumber of sections, but the combination with the code generator
  158. Xand linker assume that you start each assembly file by introducing the
  159. Xfollowing sections:
  160. X.ta 0.25i 1i
  161. X.HS
  162. X    .sect    .text
  163. X.br
  164. X    .sect    .rom
  165. X.br
  166. X    .sect    .data
  167. X.br
  168. X    .sect    .bss
  169. X.HS
  170. XTo get a large sample of code, compile some C programs and inspect the
  171. Xresulting assembly code.
  172. XThis will give an idea of what the assembly language looks like.
  173. X
  174. X
  175. X
  176. /
  177. echo x - ascii
  178. sed '/^X/s///' > ascii << '/'
  179. X.CD "ascii \(en strip all the pure ASCII lines from a file"
  180. X.SX "ascii\fR [\fB\(enn\fR]\fR [\fIfile\fR]"
  181. X.FL "\(enn" "Extract the lines containing nonASCII characters"
  182. X.EX "ascii file >outf" "Write all the ASCII lines on \fIoutf\fR"
  183. X.EX "ascii \(enn <file >outf" "Write all the nonASCII lines on \fIoutf\fR"
  184. X.PP
  185. XSometimes a file contains some nonASCII characters that are in the way.
  186. XThis program allows the lines containing only ASCII characters to be 
  187. X\fIgrepped\fR from the file.  
  188. XWith the \fB\(enn\fR flag, the nonASCII lines are 
  189. X\fIgrepped\fR.  
  190. XNo matter whether the flag is used or not, the program returns an exit status 
  191. Xof true if the file is pure ASCII, and false otherwise.
  192. X
  193. X
  194. X
  195. /
  196. echo x - asize
  197. sed '/^X/s///' > asize << '/'
  198. X.CD "asize \(en report the size of an object file [68000]"
  199. X.SX "asize \fIfile\fR ..."
  200. X.FL "\fR(none)"
  201. X.EY "asize test.o" "Give the size of \fItest.o\fR"
  202. X.PP
  203. X.I Asize
  204. Xprints for each argument
  205. Xthe (decimal) number of bytes used by the different sections,
  206. Xas well as their sum in decimal and hexadecimal.
  207. XIf no
  208. X.I file
  209. Xis given \fIa.out\fR is used.
  210. X.I Asize
  211. Xcan only be used to obtain the size of a \(M2 \fI.o\fR or \fI.out\fR file. 
  212. XTo obtain the size of an executable, use
  213. X.I size
  214. Xinstead.
  215. X
  216. X
  217. X
  218. /
  219. echo x - asld
  220. sed '/^X/s///' > asld << '/'
  221. X.CD "asld \(en assembler-loader [IBM]"
  222. X.SX "asld\fR [\fB\(enLis\fR]\fR [\fB\(enT \fIdir\fR] [\fB\(eno \fIname\fR] \fIfile\fR ..."
  223. X.FL "\(enL" "A listing is produced on \fIstdout\fR"
  224. X.FL "\(enT" "Used to specify a directory for the temporary file"
  225. X.FL "\(eni" "Use separate I & D space (64K + 64K)"
  226. X.FL "\(eno" "Output goes to file named by next argument"
  227. X.FL "\(ens" "A symbol table is produced on \fIstdout\fR"
  228. X.EX "asld \(ens file.s" "Assemble \fIfile.s and \fP list symbols"
  229. X.EX "asld \(eno output file.s" "Assemble \fIfile.s\fP, put binary on \fIoutput\fP"
  230. X.EX "asld \(enT. file1.s file2.s" "Use current directory for temporary file"
  231. X.PP
  232. X.I Asld
  233. Xis the
  234. X.MX
  235. Xassembler and loader combined.
  236. XIt accepts a language similar to that accepted by the \s-2PC-IX\s+2
  237. Xassembler (see Chap. 9).
  238. XSymbols are made up of letters, digits and underscores.
  239. XThe machine instructions and addressing modes are the same as those
  240. Xused by
  241. X\s-2PC-IX\s+2, except that modes using multiple registers are written
  242. Xlike this example: 
  243. X.I "mov ax,(bx_si)."
  244. XConstant operands are denoted by a sharp sign.
  245. XLocal labels are permitted in the usual 
  246. X.UX
  247. Xstyle: the instruction 
  248. X.I "jmp 1f"
  249. Xjumps forward to the closest label 
  250. X.I 1:
  251. X.PP
  252. XThe pseudoinstructions accepted by the assembler are listed below:
  253. X.HS
  254. X.ta 0.25i 1.25i
  255. X.nf
  256. X    \fB.align\fR n    \fRAlign to a multiple of \fIn\fP bytes
  257. X    \fB.ascii\fP str    \fRAssemble a string
  258. X    \fB.asciz\fP str    \fRAssemble a zero-terminated string
  259. X    \fB.bss\fP    \fRWhat follows goes in the bss segment
  260. X    \fB.byte\fP n    \fRAssemble one or more bytes
  261. X    \fB.data\fP    \fRWhat follows goes in the data segment
  262. X    \fB.define\fP sym    \fRExport \fIsym\fR from the file
  263. X    \fB.errnz\fP n    \fRForce error if \fIn\fP is nonzero
  264. X    \fB.even\fP    \fRAlign to an even address
  265. X    \fB.extern\fP sym    \fRDeclare \fIsym\fR external
  266. X    \fB.globl\fP sym    \fRSame as \fBextern
  267. X    \fB.long\fR n    \fRAssemble \fIn\fR as a long
  268. X    \fB.org\fP adr    \fRSet address within current segment
  269. X    \fB.short\fP n    \fRAssemble \fIn\fR as a short
  270. X    \fB.space\fP n    \fRSkip \fIn\fR bytes
  271. X    \fB.text\fP    \fRWhat follows goes in the text segment
  272. X    \fB.word\fP n    \fRAssemble \fIn\fR as a word
  273. X    \fB.zerow\fP n    \fRAssemble \fIn\fP words of zeros
  274. X.fi
  275. X.HS
  276. XIn the above pseudoinstructions,
  277. X.I adr
  278. Xis an expression yielding a machine address,
  279. X.I n
  280. Xis a numeric expression,
  281. X.I str
  282. Xis a quoted string, and
  283. X.I sym
  284. Xis a symbol.
  285. XThe library
  286. X.DI /usr/lib/libc.a
  287. Xis a packed archive of assembly code.
  288. XTo see some examples of it, extract some files from the archive with
  289. X.I ar
  290. Xand then use the filter 
  291. X.I libupack
  292. Xto convert them to readable ASCII.
  293. X.PP
  294. XIBM PC
  295. X.MX
  296. Xdoes not use
  297. X.I \&.o
  298. Xfiles.
  299. XCompiler output is packed assembly language, as are the modules in an archive.
  300. XThis scheme requires reassembling archive modules all the time, but it saves
  301. Xspace.
  302. XThe 68000 versions use \fI.o\fR files.
  303. XSee also Chap. 9.
  304. X
  305. X
  306. X
  307. /
  308. echo x - ast
  309. sed '/^X/s///' > ast << '/'
  310. X.CD "ast \(en add symbol table to executable file [IBM]"
  311. X.SX "ast\fR [\fB\(enXx\fR]\fR [\fIfile\fR] [\fIsymbol_file\fR]"
  312. X.FL "\(enX" "Preserve local symbols (except compiler generated ones)"
  313. X.FL "\(enx" "Do not preserve local symbols"
  314. X.EY "ast \(enX a.out" "Add symbols from \fIsymbol.out\fR to \fIa.out\fR"
  315. X.PP
  316. X\fIAst\fR adds the symbol table produced by the \fB\(ens\fR 
  317. Xoption of asld to the executable file.  
  318. XIf no symbol table file is listed, the default
  319. Xname \fIsymbol.out\fR is used.  
  320. XThe symbol table can also be directly added to an executed file by the
  321. Xcommands \fIcc \(ens prog.c\fR.
  322. X
  323. X
  324. X.SP -0.2
  325. /
  326. echo x - astrip
  327. sed '/^X/s///' > astrip << '/'
  328. X.CD "astrip \(en remove symbols [68000]"
  329. X.SX "astrip \fIfile\fR ..."
  330. X.FL "\fR(none)"
  331. X.EY "astrip kernel.out" "Removes the symbol table from \fIkernel.out\fR"
  332. X.PP
  333. X.I Astrip
  334. Xremoves the symbol table ordinarily attached to
  335. XACK format object files.
  336. X.I Astrip
  337. Xcan only be used to remove the symbol table from a 
  338. X.MX
  339. X\fI.out\fR file. 
  340. XIt cannot be used to remove symbol tables from executables.
  341. XTo do that use
  342. X.I strip
  343. Xinstead.
  344. X
  345. X
  346. X
  347. /
  348. echo x - at
  349. sed '/^X/s///' > at << '/'
  350. X.CD "at \(en execute commands at a later time"
  351. X.SX "at \fItime\fR [\fImonth day\fR] [\fIfile\fR]"
  352. X.FL "\fR(none)"
  353. X.EX "at 2315 Jan 31 myfile" "Myfile executed Jan 31 at 11:15 pm"
  354. X.EX "at 0900" "Job input read from \fIstdin\fR"
  355. X.EX "at 0711 4 29 " "Read from \fIstdin\fR, exec on April 29"
  356. X.PP
  357. X\fIAt\fR prepares a file to be executed later at the specified time by 
  358. Xcreating a special entry in \fI/usr/spool/at\fR.  
  359. XThe program \fIatrun\fR should be started 
  360. Xperiodically, for example, every minute by \fIcron\fR.  \fIAtrun\fR 
  361. Xchecks to see if any
  362. Xfiles in \fI/usr/spool/at\fR should now be run, and if so, it runs them 
  363. Xand then puts them in \fI/usr/spool/at/past\fR.
  364. XThe name of the file created in \fI/usr/spool/at\fR by 
  365. X\fIat\fR is YY.DDD.HHMM.UU (where YY, DDD, HH, and MM give the time to execute and 
  366. XUU is a unique number).  Note that when the command runs, it will not be able 
  367. Xto use \fIstdin\fR or \fIstdout\fR unless specifically redirected.  In 
  368. Xthe first example above, it might be necessary to put \fI>/dev/tty0\fR
  369. Xon some lines in the shell script \fImyfile\fR.  
  370. XThe same holds for the commands typed directly to \fIat\fR.
  371. X
  372. X
  373. X
  374. /
  375. echo x - backup
  376. sed '/^X/s///' > backup << '/'
  377. X.CD "backup \(en backup files"
  378. X.SX "backup\fR [\fB\(endjmnorstvz\fR] \fIdir1 dir2"
  379. X.FL "\(end" "At top level, only directories are backed up"
  380. X.FL "\(enj" "Do not copy junk: \fI *.Z, *.bak, a.out, core\fR, etc"
  381. X.FL "\(enm" "If device full, prompt for new diskette"
  382. X.FL "\(enn" "Do not backup top-level directories"
  383. X.FL "\(eno" "Do not copy \fI*.o\fR files"
  384. X.FL "\(enr" "Restore files"
  385. X.FL "\(ens" "Do not copy \fI*.s\fR files"
  386. X.FL "\(ent" "Preserve creation times"
  387. X.FL "\(env" "Verbose; list files being backed up"
  388. X.FL "\(enz" "Compress the files on the backup medium"
  389. X.EX "backup \(enmz . /f0" "Backup current directory compressed"
  390. X.EX "backup /bin /usr/bin" "Backup bin from RAM disk to hard disk"
  391. X.PP
  392. X\fIBackup\fR (recursively) backs up the contents of a given directory and its
  393. Xsubdirectories to another part of the file system.
  394. XIt has two typical uses.
  395. XFirst, some portion of the file system can be backed up onto 1 or more
  396. Xdiskettes.
  397. XWhen a diskette fills up, the user is prompted for a new one.
  398. XThe backups are in the form of mountable file systems.
  399. XSecond, a directory on RAM disk can be backed up onto hard disk.
  400. XIf the target directory is empty, the entire source directory is copied
  401. Xthere, optionally compressed to save space.
  402. XIf the target directory is an old backup, only those files in the target
  403. Xdirectory that are older than similar names in the source directory are
  404. Xreplaced.
  405. X\fIBackup\fR uses times for this purpose, like \fImake\fR.
  406. XCalling \fIBackup\fR as \fIRestore\fR is equivalent to using the -r option; 
  407. Xthis replaces newer files in the target directory with older files from the
  408. Xsource directory, uncompressing them if necessary.  The target directory
  409. Xcontents are thus returned to some previous state.
  410. /
  411. echo x - badblocks
  412. sed '/^X/s///' > badblocks << '/'
  413. X.CD "badblocks \(en put a list of bad blocks in a file"
  414. X.SX "badblocks \fIblock_special\fR [\fIblock\fR] ..."
  415. X.FL "\fR(none)"
  416. X.EX "badblocks /dev/hd1~~~~~~~" "Handle bad blocks on \fI/dev/hd1\fP"
  417. X.EX "badblocks /dev/hd3 310 570 1680 " "Three bad blocks on \fI/dev/hd3\fP"
  418. X.PP
  419. XIf a device contains bad sectors, it is important to not have them
  420. Xallocated to important files.  This program makes it possible to collect
  421. Xup to 7 bad blocks into a dummy file, so they will not be allocated for a 
  422. X\*(OQreal\*(CQ file.  
  423. XWhen the program starts up, it asks for a list of bad blocks, unless
  424. Xthey are provided as arguments.
  425. XThen it creates a file whose name is of the
  426. Xform \fI.Bad_xxxxx\fR, where \fIxxxxx\fR is a pid.
  427. X
  428. X
  429. X.SP 0.7
  430. /
  431. echo x - banner
  432. sed '/^X/s///' > banner << '/'
  433. X.CD "banner \(en print a banner"
  434. X.SX "banner \fIarg ..."
  435. X.FL "\fR(none)"
  436. X.EY "banner happy birthday" "Print a banner saying happy birthday"
  437. X.PP
  438. X\fIBanner\fR prints its arguments on \fIstdout\fR using a matrix 
  439. Xof 6 x 6 pixels per character.  The @ sign is used for the pixels.
  440. X
  441. X
  442. X
  443. /
  444. echo x - basename
  445. sed '/^X/s///' > basename << '/'
  446. X.CD "basename \(en strip off file prefixes and suffixes"
  447. X.SX "basename \fIfile\fR [\fIsuffix\fR]
  448. X.FL "\fR(none)"
  449. X.EX "basename /user/ast/file.c" "Strips path to yield \fIfile.c\fP"
  450. X.EX "basename /user/file.c .c" "Strips path and \fI.c\fP to yield \fIfile\fP"
  451. X.PP
  452. XThe initial directory names (if any) are removed yielding the name of the
  453. Xfile itself.
  454. XIf a second argument is present, it is interpreted as a suffix and is
  455. Xalso stripped, if present.
  456. XThis program is primarily used in shell scripts.
  457. X
  458. X
  459. X
  460. /
  461. echo x - bawk
  462. sed '/^X/s///' > bawk << '/'
  463. X.CD "bawk \(en pattern matching language"
  464. X.SX "bawk \fIrules\fR [\fIfile\fR] ...
  465. X.FL "\fR(none)"
  466. X.EX "bawk rules input" "Process \fIinput\fR according to \fIrules\fR"
  467. X.EX "bawk rules \(en  >out" "Input from terminal, output to \fIout\fR"
  468. X.PP
  469. X\fIAwk\fR is a pattern matching language.
  470. X\fIBawk\fR is Basic Awk, a subset of the original.
  471. XThe file name \(en can be used to designate \fIstdin\fR.
  472. XThe manual is given in Chap. 9.
  473. X
  474. X
  475. /
  476. echo x - btoa
  477. sed '/^X/s///' > btoa << '/'
  478. X.CD "btoa \(en binary to ascii conversion"
  479. X.SX "btoa\fR [\fB\(enadhor\fR]\fR [\fIinfile\fR] [\fIoutfile\fR]"
  480. X.FL "\(ena" "Decode, rather than encode, the file"
  481. X.FL "\(end" "Extracts repair file from diagnosis file"
  482. X.FL "\(enh" "Help menu is displayed giving the options"
  483. X.FL "\(eno" "The obsolete algorithm is used for backward compatibility"
  484. X.FL "\(enr" "Repair a damaged file"
  485. X.EX "btoa <a.out >a.btoa" "Convert \fIa.out\fR to ASCII"
  486. X.EX "btoa \(ena <a.btoa >a.out" "Reverse the above"
  487. X.PP
  488. X\fIBtoa\fR is a filter that converts a binary file to ascii for transmission
  489. Xover a telephone line.  If two file names are provided, the first in used for
  490. Xinput and the second for output.  If only one is provided, it is used as the
  491. Xinput file.  The program is a functionally similar alternative 
  492. Xto \fIuue/uud\fR, but the encoding is completely different.
  493. XSince both of these are widely used, both have been provided with 
  494. X.MX .
  495. XThe file is expanded about 25 percent in the process.
  496. X
  497. X
  498. X
  499. /
  500. echo x - cal
  501. sed '/^X/s///' > cal << '/'
  502. X.CD "cal \(en print a calendar"
  503. X.SX "cal\fR [\fImonth\fR] \fIyear"
  504. X.FL "\fR(none)"
  505. X.EY "cal 3 1992" "Print March 1992"
  506. X.PP
  507. X\fICal\fR prints a calendar for a month or year.  The year can be 
  508. Xbetween 1 and 9999.  
  509. XNote that the year 91 is not a synonym for 1991, but is itself a
  510. Xvalid year about 19 centuries ago.  The calendar produced is the one used
  511. Xby England and her colonies.  Try Sept. 1752, Feb 1900, and Feb 2000.  If
  512. Xyou do not understand what is going on, look up \fICalendar, Gregorian\fR in a
  513. Xgood encyclopedia.
  514. X
  515. X
  516. X.SP 2.5
  517. /
  518. echo x - calendar
  519. sed '/^X/s///' > calendar << '/'
  520. X.CD "calendar \(en reminder service"
  521. X.SX "calendar [\fB\(en\fR] [\fB\(enr\fR]"
  522. X.FL "\(en" "Work for every user and send mail to him"
  523. X.FL "\(enr" "Restrict multiple execution on the same day"
  524. X.EX "calendar" "Check \fIcalendar\fR file in current directory"
  525. X.EX "calendar" "Normary used under the control of cron(8)"
  526. X.EX "calendar \(enr" " Normary used in /etc/rc file"
  527. X.PP
  528. XBasically \fIcalendar\fR program consults the file \fIcalendar\fR in the 
  529. Xcurrent directory and display lines which contain today's or tomorrow's date.
  530. XMonth-day formats such as '12/25', 'Dec. 25', 
  531. X'december 25', '*/25', '12/*', '*/*' are recognized.  The asterisk
  532. Xmeans 'all' days or 'all' months.  On weekends 'tomorrow' extends through 
  533. Xnext Monday without any consideration about holidays.
  534. XTo prevent ambiguity, the formats '25 Dec.' and '25/12' are not recognized.
  535. X.PP
  536. XWhen an argument \fB\(en\fR is present, \fIcalendar\fR works for all users
  537. Xwith a file \fIcalendar\fR in their login directories and sends them mail.
  538. XNormally this is done daily under the control of \fIcron\fR.
  539. X.PP
  540. XThe \fB\(enr\fR option does its the same job as \fB\(en\fR option, but touches
  541. Xthe \fIcalendar\fR to prevents further access on the same day.
  542. XNormally this is done in the \fI/etc/rc\fR file on a machine  which may be
  543. Xbooted several times in one day.
  544. /
  545. echo x - cat
  546. sed '/^X/s///' > cat << '/'
  547. X.CD "cat \(en concatenate files and write them to \fIstdout\fP"
  548. X.SX "cat\fR [\fB\(enu\fR]\fR [\fIfile\fR] ..."
  549. X.FL "\(enu" "Unbuffered output"
  550. X.EX "cat file" "Display file on the terminal"
  551. X.EX "cat file1 file2 | lpr" "Concatenate 2 files and print result"
  552. X.PP
  553. X.I Cat
  554. Xconcatenates its input files and copies the result to \fIstdout\fR.
  555. XIf no input file is named, or \(en is encountered as a file name, standard
  556. Xinput is used.
  557. XOutput is buffered in 512 byte blocks unless the 
  558. X.B \(enu
  559. Xflag is given.
  560. XIf you just want to copy a file, \fIcp\fR should be used since it is faster.
  561. X.SP 2.5
  562. X
  563. X
  564. /
  565. echo x - cc
  566. sed '/^X/s///' > cc << '/'
  567. X.CD "cc \(en C compiler"
  568. X.SX "cc\fR [\fB\(enFLRSTUciosvw\fR]\fR [\fB\(enD\fIname\fR] ... [\fB\(enI\fIdir\fR] ... [\fB\(enLIB\fR] \fIfile\fR ..."
  569. X.FL "\(enD" "The flag \fB\(enD\fIx=y\fR defines a macro \fIx\fR with (optional) value \fIy\fR"
  570. X.FL "\(enF" "Use a file instead of a pipe for preprocessor output [IBM]"
  571. X.FL "\(enI" "\fB\(enI\fIdir\fR searches \fIdir\fP for include files"
  572. X.FL "\(enL" "List the assembly code on \fIstdout\fR [IBM]"
  573. X.FL "\(enLIB~\fRProduce a library module [IBM]" ""
  574. X.FL "\(enR" "Complain about all non Kernighan & Ritchie code"
  575. X.FL "\(enS" "Produce an assembly code file, then stop"
  576. X.FL "\(enT" "The flag \fB\(enT\fIdir\fR tells \fIcem\fR to use \fIdir\fR for temporary files"
  577. X.FL "\(enU" "Undefine a macro"
  578. X.FL "\(enc" "Compile only. Do not link.
  579. X.FL "\(eni" "Use separate I & D space (64K + 64K) [IBM]"
  580. X.FL "\(eno" "Put output on file named by next arg"
  581. X.FL "\(ens" "For IBM, add symbol table; for 68000 strip symbol table"
  582. X.FL "\(env" "Verbose; print pass names"
  583. X.FL "\(enw" "Suppress warning messages"
  584. X.EX "cc \(enc file.c" "Compile \fIfile.c\fP"
  585. X.EX "cc \(enD_MINIX file.c" "Treat the symbol \fI_MINIX\fP as defined"
  586. X.EX "cc \(enc \(enLIB file.c" "Make a module for the library"
  587. X.PP
  588. XThis is the C compiler.
  589. XIt has multiple passes.
  590. XThe names of the programs executed for each pass, their inputs and their
  591. Xoutputs are given in the table below.
  592. X.HS
  593. X.ta 1.4i 2.1i 2.8i 3.5
  594. X   \fBProgram    Input    Output    Operation performed\fR
  595. X.br
  596. X   /lib/cpp    prog.c    prog.i    C preprocessor [IBM]
  597. X.br
  598. X   /lib/cem    prog.i    prog.k    Parsing and semantic analysis
  599. X.br
  600. X   /usr/lib/opt    prog.k    prog.m    Optimization of the intermediate code
  601. X.br
  602. X   /usr/lib/cg    prog.m    prog.s    Code generation
  603. X.br
  604. X   /usr/bin/asld    prog.s    a.out    Assembly and linking [IBM]
  605. X.br
  606. X   /usr/bin/as    prog.s    prog.o    Assembly [68000]
  607. X.br
  608. X   /usr/lib/ld    prog.o    .out    Linking [68000]
  609. X.br
  610. X   /usr/lib/cv    .out    a.out    Conversion to \s-2MINIX\s0 format [68000]
  611. X.HS
  612. XThe main program,
  613. X.I cc ,
  614. Xforks appropriately to call the passes, transmitting flags and arguments.
  615. XThe \fB\(env\fR flag causes the passes to be listed as they are called.
  616. X.PP
  617. XThe IBM C compiler uses a combined assembler-linker that takes in assembly
  618. Xcode files in packed format and produces an \fIa.out\fR file.
  619. XThe 68000 C compiler uses normal \fI.o\fR files.
  620. XAssembly language files on the IBM can be packed and unpacked using the
  621. Xfilters \fIlibpack\fR and \fIlibupack\fR.
  622. XThe IBM libraries are 
  623. Xarchives of packed assembly code files, except that defined symbols
  624. Xmust be declared by \fI.define\fP statements at the beginning.
  625. XTo make modules for inclusion in the library, use the \fB\(enc\fP and
  626. X\fB\(enLIB\fP options.
  627. XIf you compile library modules by accident without using the \fB\(enLIB\fR
  628. Xflag, they will not be recognized, leading to undefined reference error
  629. Xmessages from the linker.
  630. X.PP
  631. XIf memory is tight, use the \fB\(enF\fR flag to force the compiler to
  632. Xrun the passes one at a time, without pipes.
  633. XWhen available memory is very limited, it may be
  634. Xnecessary to run
  635. X.I chmem
  636. Xto reduce the sizes of some compiler passes.
  637. XOn the other hand, 
  638. Xif the compiler (or, in fact, almost any program)
  639. Xbegins acting strange, it is almost always due to its running
  640. Xout of stack or disk space.
  641. XThe relevant pass can be given more stack space using
  642. X.I chmem .
  643. XFor large programs, it make take a little experimenting to get the sizes
  644. Xright.
  645. XThe \fIcem\fR is usually the guilty party.
  646. XBe careful about \fI/tmp\fR filling up too.
  647. XMore space for scratch files can be obtained by removing other files
  648. Xof using \fB\(enT\fR.
  649. X.PP
  650. XThe compiler is derived from the ACK system (Tanenbaum et 
  651. Xal., \fICommunications of the ACM\fR, Sept. 1983),
  652. Xnot from the AT&T portable C compiler.
  653. XThe sources are available from the companies listed after the Table of
  654. XContents.
  655. X
  656. X
  657. X
  658. /
  659. echo x - cdiff
  660. sed '/^X/s///' > cdiff << '/'
  661. X.CD "cdiff \(en context diff"
  662. X.SX "cdiff\fR [\fB\(enc\fIn\fR] \fIoldfile \fInewfile"
  663. X.FL "\(enc" "Provide \fIn\fR lines of context"
  664. X.EX "cdiff old new >f" "Write context diff on \fIf\fR"
  665. X.EX "cdiff \(enc1 old new >f" "Use only 1 line of context"
  666. X.PP
  667. X\fICdiff\fR produces a context diff by first running \fIdiff\fR and then 
  668. Xadding context.  
  669. XSome update programs, like \fIpatch\fR, can use context diffs to update
  670. Xfiles, even in the presence of other, independent changes.
  671. X
  672. X
  673. X
  674. /
  675. echo x - cgrep
  676. sed '/^X/s///' > cgrep << '/'
  677. X.CD "cgrep \(en grep and display context"
  678. X.SX "cgrep\fR [\fB\(ena \fIn\fR]\fR [\fB\(enb \fIn\fR] [\fB\(enf\fR] [\fB\(enl \fIn\fR]  [\fB\(enn\fR] [\fB\(enw \fIn\fR] \fIpattern\fR [\fIfile\fR] ...
  679. X.FL "\(ena" "How many lines to display after the matching line"
  680. X.FL "\(enb" "How many lines to display before the matching line"
  681. X.FL "\(enf" "Suppress file name in the output"
  682. X.FL "\(enl" "Lines are truncated to this length before comparison"
  683. X.FL "\(enn" "Suppress line numbers in the output"
  684. X.FL "\(enw" "Sets window size (same as \fB\(ena\fR n \fB\(enb\fR n)"
  685. X.EY "cgrep \(enw 3 hello file1" "Print 3 lines of context each way"
  686. X.PP
  687. X\fICgrep\fR is a program like \fIgrep\fR, except that it also can print
  688. Xa few lines above and/or below the matching lines.
  689. XIt also prints the line numbers of the output.
  690. X
  691. X
  692. X
  693. /
  694. echo x - chgrp
  695. sed '/^X/s///' > chgrp << '/'
  696. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  697. X.CD "chgrp \(en change group"
  698. X.SX "chgrp [\fB\(enR\fR] [\fIuser.\fR]\fIgroup \fIfile\fR ..."
  699. X.FL "\(enR" "Change directory hierarchies"
  700. X.EX "chgrp system file1 file2" "Make \fIsystem\fR the group of the files"
  701. X.EX "chrgp \(enR other dir1" "Make \fIother\R the group of all files below dir1"
  702. X.PP
  703. XThe group field (and optionally user field) of the named files is changed to 
  704. X.I group
  705. Xand
  706. X.I user .
  707. XAlternatively, a decimal gid (uid) may be specified instead of a group name.
  708. XIf the \fB\(enR\fR flag is used, the changes will be applied recursively to
  709. Xall files in named directories. Only the superuser may execute this command.
  710. X
  711. X
  712. X
  713. /
  714. echo x - chmem
  715. sed '/^X/s///' > chmem << '/'
  716. X.CD "chmem \(en change memory allocation"
  717. X.SX "chmem\fR [\fB+\fR]\fR [\fB\(en\fR] [\fB=\fR] \fIamount file
  718. X.FL "\fR(none)"
  719. X.EX "chmem =50000 a.out" "Give \fIa.out\fP 50K of stack space"
  720. X.EX "chmem \(en4000 a.out" "Reduce the stack space by 4000 bytes"
  721. X.EX "chmem +1000 file1" "Increase each stack by 1000 bytes"
  722. X.PP
  723. XWhen a program is loaded into memory, it is allocated enough memory
  724. Xfor the text and data+bss segments, plus
  725. Xan area for the stack.
  726. XData segment growth using 
  727. X.I malloc ,
  728. X.I brk ,
  729. Xor
  730. X.I sbrk 
  731. Xeats up stack space from the low end.
  732. XThe amount of stack space to allocate is derived
  733. Xfrom a field in the executable program's file header.
  734. XIf the combined stack and data segment growth exceeds the stack space
  735. Xallocated, the program will be terminated.
  736. X.PP
  737. XIt is therefore important to set the amount of stack space carefully.
  738. XIf too little is provided, the program may crash.
  739. XIf too much is provided, memory will be wasted, and fewer programs will be able
  740. Xto fit in memory and run simultaneously.
  741. X.MX
  742. Xdoes not swap, so that when memory is full, subsequent attempts to fork will
  743. Xfail.
  744. XThe compiler sets the stack space
  745. Xto the largest possible value (for the Intel CPUs, 64K \(en text \(en data).
  746. XFor many programs, this value is far too large.
  747. XNonrecursive programs that do not call
  748. X.I brk ,
  749. X.I sbrk ,
  750. Xor
  751. X.I malloc ,
  752. Xand do not have any local arrays usually do not need more than 8K of stack
  753. Xspace.
  754. X.PP
  755. XThe
  756. X.I chmem
  757. Xcommand changes the value of the header field that determines the stack allocation, and
  758. Xthus indirectly the total memory required to run the program.
  759. XThe = option sets the stack size
  760. Xto a specific value; the + and \(en options increment and decrement the
  761. Xcurrent value by the indicated amount.
  762. XThe old and new stack sizes are printed.
  763. X
  764. X
  765. X
  766. /
  767. echo x - chmod
  768. sed '/^X/s///' > chmod << '/'
  769. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  770. X.CD "chmod \(en change access mode for files"
  771. X.SX "chmod [\fB\(enR\fR] \fImode \fIfile\fR ..."
  772. X.FL "\(enR" "Change hierarchies recursively"
  773. X.EX "chmod 755 file" "Owner: rwx Group: r\(enx Others: r\(enx"
  774. X.EX "chmod +x file1 file2" "Make \fIfile1\fR and \fIfile2\fR executable"
  775. X.EX "chmod a\(enw file" "Make \fIfile\fR read only"
  776. X.EX "chmod u+s file" "Turn on SETUID for \fIfile\fR"
  777. X.EX "chmod \(enR o+w dir" "Allow writing for all files in dir"
  778. X.PP
  779. XThe given mode is applied to each file in the file list. If the \fB\(enR\fR
  780. Xflag is present, the files in a directory will be changed as well.
  781. XThe mode can be either absolute or symbolic. Absolute modes are given as an
  782. Xoctal number that represents the new file mode. The mode bits are defined as
  783. Xfollows: 
  784. X.ta 0.25i
  785. X.nf
  786. X.HS
  787. X    4000    Set effective user id on execution to file's owner id
  788. X    2000    Set effective group id on execution to file's group id
  789. X    0400    file is readable by the owner of the file
  790. X    0200    writeable by owner
  791. X    0100    executable by owner
  792. X    0070    same as above, for other users in the same group
  793. X    0007    same as above, for all other users
  794. X.HS
  795. X.fi
  796. XSymbolic modes modify the current file mode in a specified way. The form is:
  797. X.HS
  798. X    [who] op permissions { op permissions ...} {, [who] op ... }
  799. X.HS
  800. XThe possibilities for \fIwho\fR are \fIu\fR, \fIg\fR, \fIo\fR, and \fIa\fR,
  801. Xstanding for user, group, other and all, respectively.  
  802. XIf \fIwho\fR is omitted, \fIa\fR is assumed, but the current umask is used.  
  803. XThe op can be \fI+\fR, \fI-\fR, or \fI=\fR;  \fI+\fR turns on the 
  804. Xgiven permissions, \fI\(en \fRturns them off; \fI=\fR sets the permissions 
  805. Xexclusively for the given \fIwho\fR.  
  806. XFor example \fIg=x\fR sets the group permissions to \fI--x\fR. 
  807. X.PP
  808. XThe possible permissions are \fIr\fR, \fIw\fR, \fIx\fR; which stand for read, 
  809. Xwrite, and execute;  \fIs\fR turns on the set effective user/group id bits.  
  810. X\fIs\fR only makes sense with \fIu\fR and \fIg\fR;\fR o+s\fR is 
  811. Xharmless.
  812. X
  813. X
  814. X
  815. /
  816. echo x - chown
  817. sed '/^X/s///' > chown << '/'
  818. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  819. X.CD "chown \(en change owner"
  820. X.SX "chown [\fB\(enR\fR] \fIuser\fR[.\fIgroup\fR] \fIfile\fR ..."
  821. X.FL "\(enR" "Change directory hierarchies"
  822. X.EX "chown ast file1 file2" "Make \fIast\fR the owner of the files"
  823. X.EX "chown \(enR ast.other dir" "Change the owner and group of all files in dir"
  824. X.PP
  825. XThe owner field (and optionally group field) of the named files is changed
  826. Xto
  827. X.I user 
  828. X(i.e., login name specified) and
  829. X.I group .
  830. XAlternatively, a decimal uid(gid) may be specified instead of a user name.
  831. XOnly the superuser may execute this command.
  832. X
  833. X
  834. X
  835. /
  836. echo x - cksum
  837. sed '/^X/s///' > cksum << '/'
  838. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  839. X.CD "cksum \(en display file checksum and size"
  840. X.SX "cksum [\fIfile\fR ...]"
  841. X.FL "\fR(none)"
  842. X.EX "cksum" "Display CRC and size of \fIstdin\fR"
  843. X.EX "cksum *.c" "Display CRC and size of \fI.c\fP files"
  844. X.PP
  845. X.I Cksum
  846. Xcalculates and writes to standard output the 32-bits CRC of the input
  847. X.I files ,
  848. Xor of stdin if no
  849. X.I files
  850. Xwere specified. The size in bytes of each
  851. X.I file
  852. Xwill be displayed after a space. The name of each
  853. X.I file
  854. Xwill be displayed after another space.
  855. X
  856. X
  857. X
  858. X
  859. /
  860. echo x - clr
  861. sed '/^X/s///' > clr << '/'
  862. X.CD "clr \(en clear the screen"
  863. X.SX "clr~~~~~~~~" 
  864. X.FL "\fR(none)"
  865. X.EY "clr    ~" "Clear the screen"
  866. X.PP
  867. XAll text is removed from the screen, resulting in an empty screen with the
  868. Xcursor positioned in the upper left-hand corner.
  869. X
  870. X
  871. X
  872. X.SP 1.7
  873. /
  874. echo x - cmp
  875. sed '/^X/s///' > cmp << '/'
  876. X.CD "cmp \(en compare two files"
  877. X.SX "cmp\fR [\fB\(enls\fR] \fIfile1 file2"
  878. X.FL "\(enl" "Loud mode. Print bytes that differ (in octal)"
  879. X.FL "\(ens" "Silent mode.  Print nothing, just return exit status"
  880. X.EX "cmp file1 file2" "Tell whether the files are the same"
  881. X.EX "cmp \(enl file1 file2" "Print all corresponding bytes that differ"
  882. X.PP
  883. XTwo files are compared.
  884. XIf they are identical, exit status 0 is returned.
  885. XIf they differ, exit status 1 is returned.
  886. XIf the files cannot be opened, exit status 2 is returned.
  887. XIf
  888. X.I file1
  889. Xis \(en ,
  890. X\fIstdin\fR is compared to 
  891. X.I file2 .
  892. X
  893. X
  894. X
  895. /
  896. echo x - comm
  897. sed '/^X/s///' > comm << '/'
  898. X.CD "comm \(en print lines common to two sorted files"
  899. X.SX "comm\fR [\fB\(en123\fR] \fIfile1 file2
  900. X.FL "\(en1" "Suppress column 1 (lines present only in \fIfile1\fP)" 
  901. X.FL "\(en2" "Suppress column 2 (lines present only in \fIfile2\fP)" 
  902. X.FL "\(en3" "Suppress column 3 (lines present in both files)"
  903. X.EX "comm file1 file2" "Print all three columns"
  904. X.EX "comm \(en12 file1 file2" "Print only lines common to both files"
  905. X.PP
  906. XTwo sorted files are read and compared.
  907. XA three column listing is produced.
  908. XFiles only in 
  909. X.I file1
  910. Xare in column 1;
  911. Xfiles only in
  912. X.I file2
  913. Xare in column 2;
  914. Xfiles common to both files are in column 3.
  915. XThe file name \(en means \fIstdin\fR. 
  916. X
  917. X
  918. X
  919. X.SP 1.5
  920. /
  921. echo x - compress
  922. sed '/^X/s///' > compress << '/'
  923. X.CD "compress \(en compress a file using modified Lempel-Ziv coding"
  924. X.SX "compress\fR [\fB\(encdfv\fR]\fR [\fIfile\fR] ..."
  925. X.FL "\(enc" "Put output on \fIstdout\fR instead of on \fIfile.Z\fR"
  926. X.FL "\(end" "Decompress instead of compress"
  927. X.FL "\(enf" "Force output even if there is no saving"
  928. X.FL "\(env" "Verbose mode"
  929. X.EX "compress <infile >outfile" "Compress 1 file"
  930. X.EX "compress x y z" "Compress 3 files to \fIx.Z\fR, \fIy.Z\fR, and \fIz.Z\fR"
  931. X.EX "compress \(end file.Z" "Decompress \fIfile.Z\fR to \fIfile\fR"
  932. X.PP
  933. XThe listed files (or \fIstdin\fR, if none are given) are compressed
  934. Xusing the Ziv-Lempel algorithm.  If the output is smaller than the input,
  935. Xthe output is put on \fIfile.Z\fR or \fIstdout\fR if no files are listed.  
  936. XIf \fIcompress\fR is linked to \fIuncompress\fR, the latter is the same 
  937. Xas giving the \fB\(end\fP flag.
  938. XSimilarly, a link to \fIzcat\fR decompresses to \fIstdout\fR.
  939. XThe
  940. X.MX
  941. Xversion of \fIcompress\fR uses 13-bit compression.
  942. XThis means that when compressing files on other systems for transmission to
  943. X.MX ,
  944. Xbe sure that only 13-bit compression is used.
  945. XOn many systems, the default is 16-bit (too big).
  946. X
  947. X
  948. X.SP 1.5
  949. /
  950. echo x - cp
  951. sed '/^X/s///' > cp << '/'
  952. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  953. X.CD "cp \(en file copy"
  954. X.SX "cp [\fB\(enRf\&iprv\fR] \fIfile1\fR \fIfile2\fR"
  955. X.SX "cp [\fB\(enfR\&iprv\fR] \fIfile\fR ... \fIdirectory\fR"
  956. X.FL "\(enf" "Forced remove existing file"
  957. X.FL "\(eni" "Ask before removing existing file"
  958. X.FL "\(enp" "Preserver full mode, uid, gid and times"
  959. X.FL "\(enr" "Copy directories and treat special files as ordinary"
  960. X.FL "\(env" "Display what cp is doing"
  961. X.FL "\(enR" "Copy directories"
  962. X.EX "cp oldfile newfile" "Copy \fIoldfile\fR to \fInewfile\fR"
  963. X.EX "cp -R special newspecial" "Copy the \fIspecial\fR file"
  964. X.PP
  965. X.I Cp
  966. Xcopies one file to another, or copies one or more files to a directory.
  967. XUnless the \fB\(enr\fR flag is specified, special files will be copied as
  968. Xspecial files. Copying a directory requires either the \fB\(enr\fR or the
  969. X\fB\(enR\fR flags.
  970. X
  971. X
  972. X
  973. X
  974. /
  975. echo x - cpdir
  976. sed '/^X/s///' > cpdir << '/'
  977. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  978. X.CD "cpdir \(en copy a directory and its subdirectories"
  979. X.SX "cpdir [\fB\(enpv\fR] \fIsrcdir\fR \fIdstdir\fR"
  980. X.FL "\(enp" "Preserve the full mode, uid, gid and times"
  981. X.FL "\(env" "Display cpdir's actions"
  982. X.EY "cpdir dir1 dir2" "create \fIdir2\fR and copy \fIdir1\fR's files in it"
  983. X.PP
  984. X.I Cpdir
  985. Xis identical to \fIcp \(enR\fR command, except that the destination directory 
  986. Xis allowed to exists before the copy. Also, unlike
  987. X.I cp ,
  988. X.I cpdir
  989. Xwill preserve the link structure of the copied directory.
  990. X
  991. X
  992. X
  993. X
  994. /
  995. echo x - crc
  996. sed '/^X/s///' > crc << '/'
  997. X.CD "crc \(en print the checksum of the file data"
  998. X.SX "crc \fIfile\fR ..."
  999. X.FL "\fR(none)\fR"
  1000. X.EY "crc *.c" "Print checksums of all the C programs"
  1001. X.PP
  1002. XThe checksum of each argument is computed and printed, along with the file
  1003. Xlength and its name, one file per line.
  1004. XThis program is useful for seeing if a file transmitted to another machine
  1005. Xhas arrived correctly.
  1006. XIt is conceptually similar to \fIsum\fR, except that it uses a stronger 
  1007. Xchecksum algorithm and also prints the length.
  1008. X
  1009. X
  1010. X
  1011. X.SP 1
  1012. /
  1013. echo x - cron
  1014. sed '/^X/s///' > cron << '/'
  1015. X.CD "cron \(en clock daemon"
  1016. X.SX "cron"
  1017. X.FL "\fR(none)"
  1018. X.EY "/usr/bin/cron" "Use absolute path in \fI/etc/rc\fR"
  1019. X.PP
  1020. X\fICron\fR is clock daemon.  It is typically started up by including the
  1021. Xcommand \fI/usr/bin/cron\fR in the \fI/etc/rc\fR file.  
  1022. XOnce started, \fIcron\fR puts itself
  1023. Xin the background, so no & is needed.  It runs forever, sleeping most of
  1024. Xthe time.  Once a minute it wakes up and examines \fI/usr/lib/crontab\fR to see
  1025. Xif there is any work to do.  If there is, the work is done.  The entries of
  1026. X\fI/usr/lib/crontab\fR contain 6 elements each.  Some examples follow:
  1027. X.HS
  1028. X.nf
  1029. X.ta 0.10i 0.40i 0.70i 1.0i 1.3i 1.8i 4.0i
  1030. X\fB    Min    Hr    Dat    Mo    Day    Command\fR
  1031. X    \0*    \0*    \0*    \0*    \0*    /usr/bin/date >/dev/tty0   #print date every minute
  1032. X    \00    \0*    \0*    \0*    \0*    /usr/bin/date >/dev/tty0   #print date on the hour
  1033. X    30    \04    \0*    \0*    1-5    /bin/backup /dev/fd1       #do backup Mon-Fri at 0430
  1034. X    30    19    \0*    \0*    1,3,5    /etc/backup /dev/fd1       #Mon, Wed, Fri at 1930
  1035. X    \00    \09    25    12    \0*    /usr/bin/sing >/dev/tty0   #Xmas morning at 0900 only
  1036. X.fi
  1037. X
  1038. X
  1039. X
  1040. X
  1041. /
  1042. echo x - ctags
  1043. sed '/^X/s///' > ctags << '/'
  1044. X.CD "ctags \(en build a tags file"
  1045. X.SX "ctags \fR[\fB\(enr\fR]\fR \fIfile\fR ..."
  1046. X.FL "\(enr" "Generate refs as well as tags"
  1047. X.EY "ctags \(enr *.h *.c" "Generate the tags file"
  1048. X.PP
  1049. X\fICtags\fR generates a \fItags\fR file from a collection of
  1050. XC source files.  It can also generate a \fIrefs\fR file.
  1051. XThe \fItags\fR file is used by \fIelvis'\fR 
  1052. X\*(OQ:tag\*(CQ command, and its \fB\(ent\fR
  1053. Xoption. 
  1054. XEach C source file is scanned for \fI#define\fR statements and global
  1055. Xfunction definitions.  The name of the macro or function becomes the name of
  1056. Xa tag.  For each tag, a line is added to the \fItags\fR file which contains:
  1057. Xthe name of the tag, a tab character, the name of the file containing the tag,
  1058. Xa tab character, and a way to find the particular line within the file.
  1059. X.PP
  1060. XThe \fIrefs\fR file is used by the \fIref\fR program, which can be invoked 
  1061. Xvia \fIelvis\fR K command.  When ctags finds a global function definition, it 
  1062. Xcopies the function header into the \fIrefs\fR file.  
  1063. XThe first line is flush against the
  1064. Xright margin, but the argument definitions are indented.the C source files.
  1065. X
  1066. X
  1067. X
  1068. X.SP -0.5
  1069. /
  1070. echo x - cut
  1071. sed '/^X/s///' > cut << '/'
  1072. X.CD "cut \(en select out columns of a file"
  1073. X.SX "cut [ \fB \(enb \fR|\fB \(enc\fR] \fIlist\fR [\fIfile...\fR]"
  1074. X.SX "cut \(enf \fIlist\fR [\fB\(end \fIdelim\fR] [\fB \(ens\fR]
  1075. X[\fIfile...\fR]" 
  1076. X.FL "\(enb" "Cut specified bytes"
  1077. X.FL "\(enc" "Select out specific characters"
  1078. X.FL "\(end" "Change the column delimiter to \fIdelim\fR"
  1079. X.FL "\(enf" "Select out specific fields that are separated by the
  1080. Xdelimiter character ( see \fIdelim\fR)"
  1081. X.FL "\(eni" "Runs of delimiters count as one"
  1082. X.FL "\(ens" "Suppres lines with no delimiter characters, when used
  1083. Xwith the \(enf option. Lines with no delimiters are passwd through
  1084. Xuntouched"
  1085. X.EX "cut \(enf 2 file" "Extract field 2"
  1086. X.EX "cut \(enc 1\(en2,5 file" "Extract character columns 1, 2, and 5"
  1087. X.EX "cut \(enc 1\(en5,7\(en file" "Extract all columns except 6"
  1088. X.PP
  1089. X\fICut\fR extracts one or more fields or columns from a file and writes them on
  1090. Xstandard output.
  1091. XIf the \fB\(enf\fR flag is used, the fields are separated by a delimiter 
  1092. Xcharacter, normally a tab, but can be changed using the \fB\(end\fR flag.
  1093. XIf the \fB\(enc\fR flag is used, specific columns can be specified.
  1094. XThe list can be comma or BLANK separated. The \fB\(enf\fR and
  1095. X\fB\(enc\fR flags  are mutually exclusive.
  1096. XNote: The POSIX1003.2 standard requires the option \(enb to cut out
  1097. Xspecific bytes in a file. It is intended for systems with multi byte
  1098. Xcharacters (e.g. kanji), since MINIX uses only one byte characters,
  1099. Xthis option is equivalent to \(enc. For the same reason, the option
  1100. X\(enn has no effect and is not listed in this manual page.
  1101. X
  1102. X
  1103. X
  1104. X
  1105. /
  1106. echo x - date
  1107. sed '/^X/s///' > date << '/'
  1108. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  1109. X.CD "date \(en print or set the date and time"
  1110. X.SX "date [\fB\(enq\fR] [[\fIMMDDYY\fR]\fIhhmm\fR[\fIss\fR]\fR]"
  1111. X.SX "date [\fB\(enu\fR] [\fI+format\fR]
  1112. X.FL "\(enq" "Read the date from \fIstdin\fR"
  1113. X.FL "\(enu" "Print the date as GMT"
  1114. X.EX "date" "Print the date and time"
  1115. X.EX "date 0221921610" "Set date to Feb 21, 1992 at 4:10 p.m."
  1116. X.PP
  1117. XWith the \fB\(enq\fR flag or a numeric argument,
  1118. X.I date
  1119. Xsets the GMT time and date.
  1120. X.I MMDDYY
  1121. Xrefers to the month, day, and year;
  1122. X.I hhmmss
  1123. Xrefers to the hour, minute and second.
  1124. XEach of the six fields must be exactly two digits, no more and no less.
  1125. X.I date
  1126. Xalways display the date and time, with the default format for the system.
  1127. XThe \fB\(enu\fR flag request GMT time instead of local time.
  1128. XA format may be specified with a + followed by a printf-like string with
  1129. Xthe following options:
  1130. X.ta 0.25i
  1131. X.nf
  1132. X.HS
  1133. X    %%  % character
  1134. X    %A  Name of the day
  1135. X    %B  Name of the month
  1136. X    %D  mm/dd/yy
  1137. X    %H  Decimal hour on 2 digits
  1138. X    %I  Decimal hour modulo 12 on 2 digits
  1139. X    %M  Decimal minute on 2 digits
  1140. X    %S  Decimal seconds on 2 digits
  1141. X    %T  HH:MM:SS
  1142. X    %U  Decimal week number, Sunday being first day of week
  1143. X    %W  Decimal week number, Monday being first day of week
  1144. X    %X  Same as %T
  1145. X    %Y  Decimal year on 4 digits
  1146. X    %Z  Time Zone (if any)
  1147. X    %a  Abbreviated name of the day
  1148. X    %b  Abbreviated name of the month
  1149. X    %c  Appropriate date & time (default format)
  1150. X    %d  Decimal day of the month on 2 digits
  1151. X    %e  Same as %d, but a space replaces leading 0
  1152. X    %h  Same as %b
  1153. X    %j  Decimal dey of the year on 3 digits
  1154. X    %m  Decimal month on 2 digits
  1155. X    %n  Newline character
  1156. X    %p  AM or PM
  1157. X    %r  12-hour clock time with AM/PM
  1158. X    %t  Tab character
  1159. X    %w  Decimal day of the week (0=Sunday)
  1160. X    %x  Same as %D
  1161. X    %y  Decimal year on 2 digits
  1162. X.HS
  1163. X
  1164. X
  1165. X
  1166. /
  1167. echo x - dd
  1168. sed '/^X/s///' > dd << '/'
  1169. X.CD "dd \(en disk dumper"
  1170. X.SX "dd\fR [\fIoption = value\fR] ..."
  1171. X.FL "\fR(none)"
  1172. X.EX "dd if=/dev/fd0 of=/dev/fd1" "Copy disk 0 to disk 1"
  1173. X.EX "dd if=x of=y bs=1w skip=4" "Copy \fIx\fP to \fIy\fP, skipping 4 words"
  1174. X.EX "dd if=x of=y count=3" "Copy three 512\(enbyte blocks"
  1175. X.PP
  1176. XThis command is intended for copying partial files.
  1177. XThe block size, skip count, and number of blocks to copy can be specified.
  1178. XThe options are:
  1179. X.HS
  1180. X.ta 0.25i 1.5i
  1181. X    \fBif\fR = file    \(en Input file (default is \fIstdin\fR)
  1182. X.br
  1183. X    \fBof\fR = file    \(en Output file (default is standard output)
  1184. X.br
  1185. X    \fBibs\fR = n    \(en Input block size (default 512 bytes)
  1186. X.br
  1187. X    \fBobs\fR = n    \(en Output block size (default is 512 bytes)
  1188. X.br
  1189. X    \fBbs\fR = n    \(en Block size; sets \fIibs\fP and \fIobs\fP (default is 512 bytes)
  1190. X.br
  1191. X    \fBskip\fR = n    \(en Skip \fIn\fP input blocks before reading
  1192. X.br
  1193. X    \fBseek\fR = n    \(en Skip \fIn\fP output blocks before writing
  1194. X.br
  1195. X    \fBcount\fR = n    \(en Copy only \fIn\fP input blocks
  1196. X.br
  1197. X    \fBconv = lcase\fR    \(en Convert upper case letters to lower case
  1198. X.br
  1199. X    \fBconv = ucase\fR    \(en Convert lower case letters to upper case
  1200. X.br
  1201. X    \fBconv = swab\fR    \(en Swap every pair of bytes
  1202. X.br
  1203. X    \fBconv = noerror\fR    \(en Ignore errors and just keep going
  1204. X.HS
  1205. XWhere sizes are expected, they are in bytes.
  1206. XHowever, the letters \fBw\fR, \fBb\fR, or \fBk\fR may be appended to the
  1207. Xnumber to indicate words (2 bytes), blocks (512 bytes), or K
  1208. X(1024 bytes), respectively.
  1209. XWhen
  1210. X.I dd
  1211. Xis finished, it reports the number of full and partial blocks read and written.
  1212. X
  1213. X
  1214. X
  1215. X.SP 1
  1216. /
  1217. echo x - de
  1218. sed '/^X/s///' > de << '/'
  1219. X.CD "de \(en disk editor"
  1220. X.SX "de\fR [\fB\(enw\fR] \fIblock_device"
  1221. X.SX "de \(enr \fIfile
  1222. X.FL "\(enr" "Recover a file that has been removed"
  1223. X.FL "\(enw" "Enable writing, so device can be modified"
  1224. X.EX "de \(enr /usr/ast/prog.c" "Undo the effects of: \fIrm /usr/ast/prog.c\fR"
  1225. X.EX "de \(enw /dev/fd0" "Edit \fI/dev/fd0\fR for writing"
  1226. X.PP
  1227. X\fIDe\fR is a program for system administrators that allows disks to be
  1228. Xinspected block by block.
  1229. XA variety of display options and commands are available, as described in
  1230. XChap. 9.
  1231. XFor a summary, start the program and type \fIh\fR for help.
  1232. XThe program can also restore files that have just been removed by \fIrm\fR,
  1233. Xprovided that the i-node and blocks are still intact.
  1234. XAnother feature is searching disks for ASCII strings, to help locate things
  1235. Xafter a crash.
  1236. XFinally, individual disk words can be changed, for example, the sizes of
  1237. Xblock special files.
  1238. X
  1239. X
  1240. X
  1241. /
  1242. echo x - df
  1243. sed '/^X/s///' > df << '/'
  1244. X.CD "df \(en report on free disk space and i-nodes"
  1245. X.SX "df \fIspecial ..."
  1246. X.FL "\fR(none)"
  1247. X.EX "df /dev/ram" "Report on free RAM disk space"
  1248. X.EX "df /dev/fd0 /dev/fd1" "Report on diskette space"
  1249. X.EX "df~~~" "Report on all mounted devices"
  1250. X.PP
  1251. XThe amount of disk space and number of i-nodes, both free and used is
  1252. Xreported.
  1253. XIf no argument is given, \fIdf\fR reports on the root device and all mounted
  1254. Xfile systems.
  1255. X
  1256. X
  1257. X
  1258. /
  1259. echo x - dhrystone
  1260. sed '/^X/s///' > dhrystone << '/'
  1261. X.CD "dhrystone \(en integer benchmark"
  1262. X.SX "dhrystone"
  1263. X.FL "\fR(none)"
  1264. X.EY "dhrystone" "Run the dhrystone benchmark"
  1265. X.PP
  1266. XMany years ago, a floating-point benchmark called \fIwhetstone\fR was
  1267. Xpopular for benchmarking FORTRAN programs.
  1268. XNowadays, an integer benchmark called \fIdhrystone\fR is widely used
  1269. Xfor benchmarking UNIX systems.
  1270. XThis is it.
  1271. XBe warned, however, that \fIdhrystone\fR is entirely CPU bound, and
  1272. Xgoes blindingly fast on machines with high-speed caches.
  1273. XAlthough this is a good measure for programs that spend most of their
  1274. Xtime in some inner loop, it is a poor benchmark for I/O bound applications.
  1275. X
  1276. X
  1277. X
  1278. /
  1279. echo x - diff
  1280. sed '/^X/s///' > diff << '/'
  1281. X.CD "diff \(en print differences between two files"
  1282. X.SX "diff  \fR [\fB\(enc \fR|\fB \(ene \fR|\fB \(enC \fIn\fR\] [\fB\(enbr\fR]\fIfile1 file2\fR"
  1283. X.FL "\(enC \In" "Produce output that contains \fIn\fR lines of context"
  1284. X.FL "\(enb" "Ignore white space when comparing"
  1285. X.FL "\(enc" "Produce output that contains three lines of context"
  1286. X.FL "\(ene" "Produce an \fIed\fR-script to convert \fIfile1\fR into \fIfile2\fR"
  1287. X.FL "\(enr" "Apply \fIdiff\fR recursively to files and directories of
  1288. Xthe same name, when \fIfile1\fR and \fIfile2\fR are both directories"
  1289. X.EX "diff file1 file2" "Print differences between 2 files"
  1290. X.EX "diff -C 0 file1 file2" "Same as above"
  1291. X.EX "diff -C 3 file1 file2" "Output three lines of context with every
  1292. Xdifference encountered"
  1293. X.EX "diff -c file1 file2" Same as above"
  1294. X.EX "diff /etc /dev" "Compares recursively the directories \fI/etc\fR and \fI/dev\fR"
  1295. X.EX "diff passwd /etc" "Compares \fI./passwd\fR to \fI/etc/passwd"
  1296. X.PP
  1297. X\fIDiff\fR compares two files and generates a list of lines telling how
  1298. Xthe two files differ.  Lines may not be longer than 128 characters.
  1299. XIf the two  arguments on the command line are both directories,
  1300. X\fIdiff\fR recursively steps through all subdirectories comparing
  1301. Xfiles of the same name. If a file name is found only in one directory,
  1302. Xa diagnostic message is written to \fIstdout\fR. A file that is of
  1303. Xeither block special, character special or FIFO special type, cannot
  1304. Xbe compared to any other file.
  1305. XOn the other hand, if there is one directory and one file given on the
  1306. Xcommand line, \fIdiff\fR tries to compare the file with the same name
  1307. Xas \fIfile\fR in the directory \fIdirectory\fR.
  1308. X
  1309. X
  1310. X
  1311. /
  1312. echo x - dis88
  1313. sed '/^X/s///' > dis88 << '/'
  1314. X.CD "dis88 \(en disassembler [IBM]"
  1315. X.SX "dis88\fR [\fB\(eno\fR] \fIinfile\fR [\fIoutfile\fR]"
  1316. X.FL "\(eno" "List the object code along with the assembly code"
  1317. X.EX "dis88 a.out >listing" "Disassemble \fIa.out\fR"
  1318. X.EX "dis88 \(eno a.out listing" "Ditto, but with object code"
  1319. X.PP
  1320. X\fIDis88\fR is an 8088 disassembler.  
  1321. XIt takes an executable file and prints the
  1322. Xsymbolic assembly code that corresponds to it.  If the executable file contains
  1323. Xa symbol table (added by the program \fIast\fR), the symbol table 
  1324. Xinformation is used to give a more readable asembly listing.
  1325. XMore information is provided in Chap. 9.
  1326. X
  1327. X
  1328. X
  1329. /
  1330. echo x - diskcheck
  1331. sed '/^X/s///' > diskcheck << '/'
  1332. X.CD "diskcheck \(en check a disk for bad sectors"
  1333. X.SX "diskcheck \fIdevice \fIstart \fIcount"
  1334. X.FL "\fR(none)"
  1335. X.EX "diskcheck /dev/at0 0 1200" "Check 1.2 MB diskette"
  1336. X.EX "diskcheck /dev/at0 100 50" "Check blocks 100 to 149"
  1337. X.PP
  1338. X\fIDiskcheck\fR checks a disk for bad sectors by reading in each sector,
  1339. Xwriting a known bit pattern onto it, reading it back in and comparing with
  1340. Xwhat was written.  This check is then done a second time.  Bad sectors are 
  1341. Xreported.  After each sector is tested, the original sector is restored.
  1342. XOnly use this program on unmounted partitions.
  1343. XKilling it part way through may result in lost data.
  1344. X
  1345. X
  1346. X
  1347. /
  1348. echo x - diskcopy
  1349. sed '/^X/s///' > diskcopy << '/'
  1350. X.CD "diskcopy \(en copy a disk with only one drive [AMIGA]"
  1351. X.SX "diskcopy"
  1352. X.FL "\fR(none)"
  1353. X.EY "diskcopy" "Copy a disk using the internal disk drive"
  1354. X.PP
  1355. XBefore using
  1356. X.I diskcopy ,
  1357. Xuse
  1358. X.I chmem
  1359. Xto increase the stack+malloc area to as much as you can get away with.
  1360. XIn the ideal case you should
  1361. X.I chmem
  1362. Xit to a little over 720K (say, 750000) so you do not have to swap
  1363. Xdisks.
  1364. XIn this way, the entire diskette will be read in at once and stored in
  1365. Xmemory.
  1366. XOnce you have inserted the destination disk, the whole thing will be
  1367. Xwritten back in one fell swoop, eliminating the need to constantly
  1368. Xshuffle diskettes.
  1369. X
  1370. X
  1371. X
  1372. /
  1373. echo x - diskrtc
  1374. sed '/^X/s///' > diskrtc << '/'
  1375. X.CD "diskrtc \(en set date from a disk controller real time clock [ATARI]"
  1376. X.SX "diskrtc [bms1] [bms2] [supra] [icd]"
  1377. X.FL "bms1   \fRRead the clock from a bms 100 disk controller"
  1378. X.FL "bms2   \fRRead the clock from a bms 200 disk controller"
  1379. X.FL "supra  \fRRead the clock from a supra disk controller"
  1380. X.FL "icd       \fRRead the clock from an icd disk controller"
  1381. X.EY "diskrtc icd" "Read the date from an icd disk controller"
  1382. X.PP
  1383. X.I Diskrtc
  1384. Xreads the current date and time from the clock supplied on a disk
  1385. Xcontroller and sets the time accordingly.
  1386. XThis program is usually called from
  1387. X.I /etc/rc .
  1388. X
  1389. X
  1390. X
  1391. /
  1392. echo x - diskset
  1393. sed '/^X/s///' > diskset << '/'
  1394. X.CD "diskset \(en set real time clock on disk controller [ATARI]"
  1395. X.SX "diskset [bms1] [bms2]"
  1396. X.FL "bms1  \fRSet the clock of a bms 100 disk controller"
  1397. X.FL "bms2  \fRSet the clock of a bms 200 disk controller"
  1398. X.EY "diskset bms1" "Set the clock of a bms 100 disk controller"
  1399. X.PP
  1400. X.I Diskset
  1401. Xinitializes the clock on a bms 100 or 200 diskcontroller with
  1402. X.MX 's
  1403. Xidea of the current date and time.
  1404. X
  1405. X
  1406. X
  1407. /
  1408. echo x - dosdir
  1409. sed '/^X/s///' > dosdir << '/'
  1410. X.CD "dosdir \(en list an \s-2MS-DOS\s+2 directory [IBM]"
  1411. X.SX "dosdir\fR [\fB\(enlr\fR] \fIdrive"
  1412. X.FL "\(enl" "Long listing"
  1413. X.FL "\(enr" "Recursively descend and print subdirectories"
  1414. X.EX "dosdir \(enl A" "List root directory on drive A"
  1415. X.EX "dosdir \(enr C x/y" "Recursively list directory \fIx/y\fR"
  1416. X.PP
  1417. X.I Dosdir
  1418. Xreads standard IBM PC diskettes or hard disk partitions in
  1419. X\s-2MS-DOS\s+2 format and lists their contents on standard output.
  1420. XDirectory names should contain slashes to separate components, even though
  1421. X\s-2MS-DOS\s+2 uses backslashes.
  1422. XThe names
  1423. X.I dosdir ,
  1424. X.I dosread ,
  1425. Xand 
  1426. X.I doswrite
  1427. Xare all links to the same program.
  1428. XThe program sees which function to perform by seeing how it was called.
  1429. XA drive code of
  1430. X.I A
  1431. Xcauses the program to use \fI/dev/dosA\fR, for example, 
  1432. Xa link to \fI/dev/fd0\fR.
  1433. XSimilarly, to have hard disk partition 1 be DOS drive C, \fI/dev/dosC\fR 
  1434. Xcould be a link to \fI/dev/hd1\fR, and so on for other drive codes.
  1435. X
  1436. X
  1437. X
  1438. /
  1439. echo x - dosread
  1440. sed '/^X/s///' > dosread << '/'
  1441. X.CD "dosread \(en read a file from an \s-2MS-DOS\s+2 diskette [IBM]"
  1442. X.SX "dosread\fR [\fB\(ena\fR] \fIdrive \fIfile"
  1443. X.FL "\(ena" "ASCII file"
  1444. X.EX "dosread C g/adv >adv" "Read file \fIg/adv\fR from hard disk"
  1445. X.EX "dosread \(ena A prog.c >x" "Read ASCII file \fIprog.c\fR from drive A"
  1446. X.PP
  1447. X.I Dosread
  1448. Xreads one \s-2MS-DOS\s+2 file and writes it on standard output.
  1449. XThe file name must use slash, not backslash as a separator.
  1450. XASCII files have the final CTRL-Z stripped, and carriage return plus
  1451. Xline feed are mapped to line feed only, the usual
  1452. X.MX
  1453. Xconvention.
  1454. XA drive code of
  1455. X.I A
  1456. Xcauses the program to use \fI/dev/dosA\fR, typically a link to \fI/dev/fd0\fR.
  1457. XSimilarly, to have hard disk partition 1 be DOS drive C, \fI/dev/dosC\fR 
  1458. Xshould be a link to \fI/dev/hd1\fR, and so on for other drive codes.
  1459. X
  1460. X
  1461. X
  1462. /
  1463. echo x - doswrite
  1464. sed '/^X/s///' > doswrite << '/'
  1465. X.CD "doswrite \(en write a file onto an \s-2MS-DOS\s+2 diskette [IBM]"
  1466. X.SX "doswrite\fR [\fB\(ena\fR] \fIdrive \fIfile"
  1467. X.FL "\(ena" "ASCII file"
  1468. X.EX "doswrite A x/y <z" "Write file \fIz\fR to disk as \fIx/y\fR"
  1469. X.EX "doswrite \(ena B f" "Copy \fIstdin\fR to \s-2MS-DOS\s+2 file \fIf\fR"
  1470. X.PP
  1471. X.I Doswrite
  1472. Xwrites its \fIstdin\fR to an \s-2MS-DOS\s+2 file.
  1473. XThe diskette or partition must be formatted and have an \s-2MS-DOS\s+2 file 
  1474. Xsystem already in place, including all the directories leading up to the file.
  1475. XA drive code of
  1476. X.I A
  1477. Xcauses the program to use \fI/dev/dosA\fR, typically a link to \fI/dev/fd0\fR.
  1478. XSimilarly, to have hard disk partition 1 be DOS drive C, \fI/dev/dosC\fR 
  1479. Xshould be a link to \fI/dev/hd1\fR, and so on for other drive codes.
  1480. X
  1481. X
  1482. X
  1483. /
  1484. echo x - du
  1485. sed '/^X/s///' > du << '/'
  1486. X.CD "du \(en print disk usage"
  1487. X.SX "du\fR [\fB\(enas\fR]\fR [\fB\(enl \fIn\fR] \fIdir\fR ..."
  1488. X.FL "\(ena" "Give usage for all files"
  1489. X.FL "\(enl" "List up to \fIn\fR levels of subdirectories"
  1490. X.FL "\(ens" "Summary only"
  1491. X.EX "du dir" "List disk space used by files in dir"
  1492. X.EX "du \(ens dir1 dir2" "Give summaries only"
  1493. X.PP
  1494. X\fIDu\fR examines one or more directories and prints the amount of space 
  1495. Xoccupied by the files in those directories and their subdirectories.
  1496. X
  1497. X
  1498. X
  1499. /
  1500. echo x - echo
  1501. sed '/^X/s///' > echo << '/'
  1502. X.CD "echo \(en print the arguments"
  1503. X.SX "echo\fR [\fB\(enn\fR] \fIargument\fR ..."
  1504. X.FL "\(enn" "No line feed is output when done"
  1505. X.EX "echo Start Phase 1" "\*(OQStart Phase 1\*(CQ is printed"
  1506. X.EX "echo \(enn Hello" "\*(OQHello\*(CQ is printed without a line feed"
  1507. X.PP
  1508. X.I Echo 
  1509. Xwrites its arguments to standard output.
  1510. XThey are separated by blanks and terminated with a line feed unless
  1511. X.B \(enn
  1512. Xis present.
  1513. XThis command is used mostly in shell scripts.
  1514. X
  1515. X
  1516. X
  1517. /
  1518. echo x - ed
  1519. sed '/^X/s///' > ed << '/'
  1520. X.CD "ed \(en editor"
  1521. X.SX "ed \fIfile"
  1522. X.FL "\fR(none)"
  1523. X.EY "ed prog.c" "Edit \fIprog.c\fR"
  1524. X.PP
  1525. X\fIEd\fR is functionally equivalent to the standard V7 editor, ed.  
  1526. XIt supports the following commands:
  1527. X.HS
  1528. X.nf
  1529. X.ta 0.5i 0.95i    
  1530. X    (.)    a: append
  1531. X    (.,.)    c: change
  1532. X    (.,.)    d: delete
  1533. X        e: edit new file"
  1534. X        f: print name of edited file"
  1535. X    (1,$)    g: global command
  1536. X    (.)    i: insert
  1537. X    (.,.+1)    j: join lines together
  1538. X    (.)    k: mark
  1539. X    (.)    l: print with special characters in octal
  1540. X    (.,.)    m: move
  1541. X    (.,.)    p: print
  1542. X        q: quit editor"
  1543. X    (.)    r: read in new file
  1544. X    (.,.)    s: substitute
  1545. X    (1,$)    v: like g, except select lines that do not match
  1546. X    (1,$)    w: write out edited file
  1547. X.fi
  1548. X
  1549. XMany of the commands can take one or two addresses, as indicated above.  The
  1550. Xdefaults are shown in parentheses.  Thus \fIa\fR appends to the current 
  1551. Xline, and \fIg\fR works on the whole file as default.  
  1552. XThe dot refers to the current line.
  1553. XBelow is a sample editing session with comments given following the # symbol.
  1554. X.HS
  1555. X.nf
  1556. X.ta 0.5i 2.5i
  1557. X    ed prog.c    # Edit prog.c
  1558. X    3,20p    # Print lines 3 through 20
  1559. X    /whole/    # Find next occurence of \fIwhole\fR
  1560. X    s/whole/while/    # Replace \fIwhole\fR by \fIwhile\fR
  1561. X    g/Buf/s//BUF/g    # Replace \fIBuf\fR by \fIBUF\fR everywhere
  1562. X    w    # Write the file back
  1563. X    q    # Exit the editor
  1564. X.fi
  1565. X\fIEd\fR is provided for its sentimental value.
  1566. XIf you want a line-oriented editor, try \fIex\fR.
  1567. XIf you want a good editor, use \fIelle\fR, \fIelvis\fR, or \fImined\fR.
  1568. X
  1569. X
  1570. X
  1571. /
  1572. echo x - eject
  1573. sed '/^X/s///' > eject << '/'
  1574. X.CD "eject \(en eject a diskette from a drive [MACINTOSH]"
  1575. X.SX "eject [\fIdrive\fR]"
  1576. X.FL "\fR(none)"
  1577. X.EX "eject" "Eject the diskette in drive 0"
  1578. X.EX "eject 2" "Eject the diskette in drive 2"
  1579. X.PP
  1580. X.I Eject
  1581. Xwill eject the diskette from the specified drive (or drive 0 if no
  1582. Xdrive is specified). 
  1583. X
  1584. X
  1585. X
  1586. /
  1587. echo x - elle
  1588. sed '/^X/s///' > elle << '/'
  1589. X.CD "elle \(en ELLE Looks Like Emacs"
  1590. X.SX "elle \fIfile\fR [\fIfile2\fR]"
  1591. X.FL "\fR(none)"
  1592. X.EY "elle file.c" "Start the editor"
  1593. X.PP
  1594. X\fIElle\fR is a screen-oriented editor that is patterned after Emacs.
  1595. XIt can edit multiple files, regardless of their length, 
  1596. Xcan support 1 or 2 windows, and has many other powerful features.
  1597. XAn \fIelle\fR manual is given in Chap. 9.
  1598. X
  1599. X
  1600. X
  1601. /
  1602. echo x - elvis
  1603. sed '/^X/s///' > elvis << '/'
  1604. X.CD "elvis \(en clone of the Berkeley vi editor"
  1605. X.SX "elvis \fR[\fB\(enRerv\fR] [\fB\(ent \fItag\fR] \fR[\fIfile\fR] ..."
  1606. X.FL "\(enR" "Set the read-only option"
  1607. X.FL "\(ene" "Start up emulating \fIex\fR"
  1608. X.FL "\(enr" "Tell the user to use \fIvirecover\fR instead
  1609. X.FL "\(ent" "Start editing at the given tag"
  1610. X.FL "\(env" "Start up emulating \fIvi\fR"
  1611. X.EX "elvis" "Call the editor"
  1612. X.EX "elvis prog.c" "edit \fIprog.c\fR"
  1613. X.PP
  1614. X\fIElvis\fR is a screen editor patterned very closely after the Berkeley
  1615. X\fIvi\fR editor.
  1616. XIt has many commands, described in Chap. 9.
  1617. XSee also \fIctags\fR, \fIex\fR, \fIref\fR, and \fIvirecover\fR.
  1618. X
  1619. X
  1620. X
  1621. /
  1622. echo x - ex
  1623. sed '/^X/s///' > ex << '/'
  1624. X.CD "ex \(en Berkeley line editor"
  1625. X.SX "ex \fR[\fB\(enRerv\fR] [\fB\(ent \fItag\fR] \fR[\fIfile\fR] ..."
  1626. X.FL "\(enR" "Set the readonly option"
  1627. X.FL "\(ene" "Start up emulating \fIex\fR"
  1628. X.FL "\(enr" "Tell the user to use \fIvirecover\fR instead
  1629. X.FL "\(ent" "Tagstart editing at the given tag"
  1630. X.FL "\(env" "Start up emulating \fIvi\fR"
  1631. X.EX "ex" "Call the editor"
  1632. X.EX "ex prog.c" "edit \fIprog.c\fR"
  1633. X.PP
  1634. X\fIEx\fR is a line editor patterned very closely after the Berkeley
  1635. Xprogram of the same name.
  1636. XIt is essentially a much improved version of \fIed\fR.
  1637. XActually, \fIex\fR is really just a link to \fIelvis\fR, which is a
  1638. X\fIvi\fR clone.
  1639. XIts commands are described in Chap. 9.
  1640. XSee also \fIctags\fR, \fIelvis\fR, \fIref\fR, and \fIvirecover\fR.
  1641. X
  1642. X
  1643. X
  1644. /
  1645. echo x - expand
  1646. sed '/^X/s///' > expand << '/'
  1647. X.CD "expand \(en convert tabs to spaces" 
  1648. X.SX "expand\fR [\fB\(en\fIt1,t2, ...\fR]\fR [\fIfile\fR]
  1649. X.FL "\(en\fIt\fR" "Tab stop positions"
  1650. X.EY "expand \(en16,32,48,64" "Expand \fIstdin\fR with tabs every 16 columns"
  1651. X.PP
  1652. X\fIExpand\fR replaces tabs in the named files with the equivalent numbers
  1653. Xof spaces.  If no files are listed, \fIstdin\fR is given.  If only one
  1654. Xtab is given, the rest are multiples of it.  The default is a tab every 8
  1655. Xspaces.
  1656. X
  1657. X
  1658. X
  1659. /
  1660. echo x - expr
  1661. sed '/^X/s///' > expr << '/'
  1662. X.CD "expr \(en evaluate experession"
  1663. X.SX "expr \fIarg ..."
  1664. X.FL "\fR(none)"
  1665. X.EY "x=\`expr \$x + 1\`" "Add 1 to shell variable x"
  1666. X.PP
  1667. X\fIExpr\fR computes the value of its argument and writes the result on
  1668. Xstandard output.  The valid operators, in order of increasing precedence,
  1669. Xare listed below.  Operators grouped by {...} have the same precedence.
  1670. XThe operators are: |, &, {<, <=, ==, !=, >=, >}, {+, \(en}, *, /, %, and :.
  1671. XParentheses are permitted.
  1672. X
  1673. X
  1674. X
  1675. /
  1676. echo x - factor
  1677. sed '/^X/s///' > factor << '/'
  1678. X.CD "factor \(en factor an integer less than 2**31"
  1679. X.SX "factor \fInumber"
  1680. X.FL "\fR(none)"
  1681. X.EY "factor 450180" "Print the prime factors of 450180"
  1682. X.PP
  1683. X\fIFactor\fR prints the prime factors of its argument in increasing order.
  1684. XEach factor is printed as many times as it appears in the number.
  1685. X
  1686. X
  1687. X
  1688. /
  1689. echo x - fdisk
  1690. sed '/^X/s///' > fdisk << '/'
  1691. X.CD "fdisk \(en partition a hard disk [IBM]"
  1692. X.SX "fdisk\fR [\fB\(enh\fIm\fR]\fR [\fB\(ens\fIn\fR]\fR [\fIfile\fR]"
  1693. X.FL "\fB\(enh" "Number of disk heads is \fIm\fR"
  1694. X.FL "\fB\(ens" "Number of sectors per track is \fIn\fR"
  1695. X.EX "fdisk /dev/hd0" "Examine disk partitions"
  1696. X.EX "fdisk \(enh9 /dev/hd0" "Examine disk with 9 heads"
  1697. X.PP
  1698. XWhen \fIfdisk\fR starts up, it reads in the partition table and displays 
  1699. Xit.
  1700. XIt then presents a menu to allow the user to modify partitions, store the
  1701. Xpartition table on a file, or load it from a file.  Partitions can be marked
  1702. Xas 
  1703. X.MX ,
  1704. XDOS or other, as well as active or not.
  1705. XUsing \fIfdisk\fR is self-explanatory.  
  1706. XHowever, be aware that
  1707. Xrepartitioning a disk will cause information on it to be lost.  
  1708. XRebooting the system \fIimmediately\fR 
  1709. Xis mandatory after changing partition sizes and parameters.
  1710. X.MX , 
  1711. X\&\s-2XENIX\s0, \s-2PC-IX\s0, and \s-2MS-DOS\s0 all have different 
  1712. Xpartition numbering schemes.
  1713. XThus when using multiple systems on the same disk, be careful.
  1714. X.PP
  1715. XFurthermore,
  1716. X.MX
  1717. Xexpects all partitions to begin on an even sector.  The \fIm\fR command, which
  1718. Xmarks a partition as 
  1719. X.MX ,
  1720. Xautomatically rounds odd partitions upward.
  1721. XThe reason that odd partition sizes do not cause a problem with
  1722. X\s-2MS-DOS\s0 is that \s-2MS-DOS\s0 allocates disk space in units of
  1723. X512-byte sectors, whereas 
  1724. X.MX
  1725. Xuses 1K blocks.
  1726. XThus an odd number of sectors is no problem for 
  1727. X\s-2MS-DOS\s0 but it is a problem for
  1728. X.MX .
  1729. XThat is why a command has been provided to round 
  1730. X.MX
  1731. Xpartitions to an even starting address and an even size.
  1732. XIf your disk has partitions for both \s-2MS-DOS\s0 and
  1733. X.MX ,
  1734. Xonly the
  1735. X.MX
  1736. Xones should be rounded off.
  1737. X\fIFdisk\fR has a variety of other features that can be seen by typing \fIh\fR.
  1738. X
  1739. X
  1740. X
  1741. /
  1742. echo x - fgrep
  1743. sed '/^X/s///' > fgrep << '/'
  1744. X.CD "fgrep \(en fast grep"
  1745. X.SX "fgrep\fR [\fB\(encfhlnsv\fR]\fR [\fIstring_file\fR] [\fIstring\fR] [\fIfile\fR] ..."
  1746. X.FL "\(enc" "Count matching lines and only print count, not the lines"
  1747. X.FL "\(enf" "Take strings from file named in following argument"
  1748. X.FL "\(enh" "Omit file headers from printout"
  1749. X.FL "\(enl" "List file names once only"
  1750. X.FL "\(enn" "Each line is preceded by its line number"
  1751. X.FL "\(ens" "Status only, no output"
  1752. X.FL "\(env" "Print only lines not matching"
  1753. X.EX "fgrep % prog.c" "Print lines containing % sign"
  1754. X.EX "fgrep \(enf pattern prog.c" "Take strings from \fIpattern\fR"
  1755. X.PP
  1756. X\fIFgrep\fR is essentially the same as grep, except that it only searches
  1757. Xfor lines containing literal strings (no wildcard characters), and it is much
  1758. Xfaster.
  1759. X
  1760. X
  1761. X
  1762. /
  1763. echo x - file
  1764. sed '/^X/s///' > file << '/'
  1765. X.CD "file \(en make a guess as to a file's type based on contents"
  1766. X.SX "file \fIname ..."
  1767. X.FL "\fR(none)"
  1768. X.EY "file a.out ar.h" "Guess at types"
  1769. X.PP
  1770. X\fIFile\fR reads the first block of a file and tries to make an 
  1771. Xintelligent guess about what kind of file it is.  
  1772. XIt understands about archives, C
  1773. Xsource programs, executable binaries, shell scripts, and English text.
  1774. X
  1775. X
  1776. X
  1777. /
  1778. echo x - find
  1779. sed '/^X/s///' > find << '/'
  1780. X.CD "find \(en find files meeting a given condition"
  1781. X.SX "find \fIdirectory \fIexpression"
  1782. X.FL "\fR(none)"
  1783. X.EX "find /  \(enname a.out \(enprint~~~~~~~~~~~~~~~~" "Print all \fIa.out\fR paths"
  1784. X.EX "find /usr/ast ! \(ennewer f \(enok rm {} \\\\\^;~~~~~~~~~~" "Ask before removing"
  1785. X.EX "find /usr \(ensize +20 \(enexec mv {} /big \\\\\^;~~~~~" "move files > 20 blks"
  1786. X.EX "find / \( \(enname a.out \(eno \(enname \(fm*.o\(fm \) \(enexec rm {}\\\\\^;" "2 conds"
  1787. X.PP
  1788. X\fIFind\fR descends the file tree starting at the given directory checking
  1789. Xeach file in that directory and its subdirectories against a predicate.
  1790. XIf the predicate is true, an action is taken.  The predicates may be
  1791. Xconnected by \fB\(ena\fR (Boolean and), \fB\(eno\fR (Boolean or) and !
  1792. X(Boolean negation).
  1793. XEach predicate is true under the conditions specified below.  The integer 
  1794. X\fIn\fR may also be +\fIn\fR to mean any value greater than \fIn\fR, 
  1795. X\fI\(enn\fR to mean any value less than
  1796. X\fIn\fR, or just \fIn\fR for exactly \fIn\fR.
  1797. X.HS
  1798. X.ta 0.25i 1.0i
  1799. X.nf
  1800. X    \(enname s    true if current filename is \fIs\fR (include shell wild cards)
  1801. X    \(ensize n    true if file size is \fIn\fR blocks
  1802. X    \(eninum n    true if the current file's i-node number is \fIn\fR
  1803. X    \(enmtime n    true if modification time relative to today (in days) is \fIn\fR
  1804. X    \(enlinks n    true if the number of links to the file is \fIn\fR
  1805. X    \(ennewer f    true if the file is newer than \fIf\fR
  1806. X    \(enperm n    true if the file's permission bits = \fIn\fR (\fIn\fR is in octal)
  1807. X    \(enuser u    true if the uid = \fIu\fR (a numerical value, not a login name)
  1808. X    \(engroup g    true if the gid = \fIg\fR (a numerical value, not a group name)
  1809. X    \(entype x    where \fIx\fR is \fBbcdfug\fR (block, char, dir, regular file, setuid, setgid)
  1810. X    \(enxdev    do not cross devices to search mounted file systems
  1811. X.fi
  1812. X.HS
  1813. XFollowing the expression can be one of the following, telling what to do
  1814. Xwhen a file is found:
  1815. X.HS
  1816. X.nf
  1817. X    \(enprint    print the file name on standard output
  1818. X    \(enexec    execute a \s-2MINIX\s0 command, {} stands for the file name
  1819. X    \(enok    prompts before executing the command
  1820. X.fi
  1821. X.HS
  1822. X
  1823. X
  1824. X
  1825. /
  1826. echo x - fix
  1827. sed '/^X/s///' > fix << '/'
  1828. X.CD "fix \(en generate new file from old one and diff listing"
  1829. X.SX "fix \fIoldfile \fIdifflist \fI>newfile"
  1830. X.FL "\fR(none)"
  1831. X.EY "fix old difflist >new" "Generate new from old and diffs"
  1832. X.PP
  1833. X\fIFix\fR accepts a diff listing produced by diff and reconstructs the
  1834. Xnew file.  It is common for people to take a file, modify it, and then
  1835. Xsend the diff listing between the old and new files to other people.
  1836. XUsing \fIfix\fR, the old file, and the diff listing, it is possible to creat
  1837. Xthe new file.  For example:
  1838. X.HS
  1839. X  diff oldfile newfile >difflist
  1840. X  fix oldfile difflist >new2
  1841. X.HS
  1842. Xwill generate a file \fInew2\fR that is identical to \fInewfile\fR.
  1843. XA more sophisticated alternative to \fIfix\fR is \fIpatch\fR,
  1844. Xas \fIfix\fR only handles old-style diffs.
  1845. X
  1846. X
  1847. X
  1848. X.SP 1
  1849. /
  1850. echo x - fold
  1851. sed '/^X/s///' > fold << '/'
  1852. X.CD "fold \(en fold long lines"
  1853. X.SX "fold\fR [\fB\(en\fIn\fR]\fR [\fIfile\fR] ..."
  1854. X.FL "\(en\fIn\fR" "How long should the output lines be"
  1855. X.EX "fold \(en60" "Fold \fIstdin\fR to 60 characters"
  1856. X.EX "fold file" "Fold \fIfile\fP to 80 characters"
  1857. X.PP
  1858. X\fIFold\fR takes copies its input from the named file (or \fIstdin\fR,
  1859. Xif none is specified) to standard output.
  1860. XHowever, lines longer than the given maximum (default 80) are broken
  1861. Xinto multiple lines of the maximum length by inserting new line characters.
  1862. X
  1863. X
  1864. X
  1865. /
  1866. echo x - format
  1867. sed '/^X/s///' > format << '/'
  1868. X.CD "format - format a diskette [IBM]"
  1869. X.SX "format [\fB\(ena\fR][\fB\(enq\fR][\fISpecial\fR [\fIkbsize\fR]] [\fB\(env [\fBdosvollabel\fR]\fR]"
  1870. X.FL "\(ena" " Sort interactive list alphabetically not by size"
  1871. X.FL "\(enq" "Quiet mode: skips asking if you are sure"
  1872. X.FL "\(env" "Volume label added along with DOS structures"
  1873. X.EX "format" "Have \fIformat\fR display a menu"
  1874. X.EX "format /dev/at0" "format disk in /dev/at0"
  1875. X.EX "format /dev/at0 360" "Format disk with 360 blocks"
  1876. X.EX "format /dev/dosA" "Format for DOS"
  1877. X.EX "format /dev/fd1 -v DOS_DISK" "Format and label DOS disk"
  1878. X.PP
  1879. X\fIFormat\fR allows the superuser to format diskettes.
  1880. XIt can format all seven non-automatic
  1881. Xdisk/media combinations that PC-Minix supports.  It will also try to
  1882. Xformat automatics, minor devices 0 through 3, if a device size is nozero.
  1883. X\fIFormat\fR will optionally add the structures \s-2MS-DOS\s0 needs if either the device
  1884. Xname is an \s-2MS-DOS\s0 device, like \fI/dev/dosA\fR, or if the 
  1885. X\\fB\(env\fR flag is used.
  1886. XIf no special file is specified in the command line \fIformat\fR will
  1887. Xdisplay a menu of choices.
  1888. XIt then allows automatic devices to be formatted even if
  1889. Xthey were made with a size of zero.
  1890. X\fIarning:\fR  Some disk drives are media sensitive, in which case
  1891. Xthe diskette must match the drive (e.g., no 360K diskettes in 1.2M drives).
  1892. X
  1893. X
  1894. X
  1895. X.CD "format \(en format a diskette [ATARI]"
  1896. X.SX "format \fIdevice\fR"
  1897. X.EY "format /dev/dd0" "Format a double sided diskette"
  1898. X.PP
  1899. X.I Format 
  1900. Xformats and verifies a diskette on the given device.
  1901. XDepending on the device specified the disk is formatted single or
  1902. Xdouble sided. Formatted disks always contain 80 tracks and 9 sectors
  1903. Xper track. The diskettess can be used under both 
  1904. X.MX
  1905. Xand TOS.
  1906. X
  1907. X
  1908. X
  1909. /
  1910. echo x - fortune
  1911. sed '/^X/s///' > fortune << '/'
  1912. X.CD "fortune \(en print a fortune"
  1913. X.SX "fortune"
  1914. X.FL "\fR(none)"
  1915. X.EY "fortune" "Print a fortune"
  1916. X.PP
  1917. X\fIFortune\fR prints a fortune at random from the fortunes file,  
  1918. X\fI/usr/lib/fortune.dat\fR.  This file consists of pieces
  1919. Xof text separated by a line containing only %%.
  1920. X
  1921. X
  1922. X
  1923. /
  1924. echo x - from
  1925. sed '/^X/s///' > from << '/'
  1926. X.CD "from \(en input half of a connection [IBM]"
  1927. X.SX "from \fIport"
  1928. X.FL "\fR(none)"
  1929. X.EX "from port | sort >x" "Fetch and sort an incoming file"
  1930. X.EX "from abc | sh" "Primitive sherver"
  1931. X.PP
  1932. X\fITo\fR and \fIfrom\fR are used together to provide connection-oriented service over an Ethernet.
  1933. XOn the sending machine, the last member of a pipeline is \fIto port\fR.  
  1934. XOn the
  1935. Xreceiving machine, the first member of a pipe line is \fIfrom port\fR.  
  1936. XThe net
  1937. Xresult is that the output of the sending pipeline goes into the input of the
  1938. Xreceiving pipeline, making pipelines work across the network. 
  1939. XSee also \fIto\fR.
  1940. X
  1941. X
  1942. X
  1943. /
  1944. echo x - fsck
  1945. sed '/^X/s///' > fsck << '/'
  1946. X.CD "fsck \(en perform file system consistency check"
  1947. X.SX "fsck\fR [\fB\(enaclmrs\fR]\fR [\fIdevice\fR] ..."
  1948. X.FL "\(ena" "Automatically repair inconsistencies"
  1949. X.FL "\(enc" "Check and list only the specified i-nodes
  1950. X.FL "\(enl" "List the files and directories in the filesytem
  1951. X.FL "\(enr" "Prompt user for repairs if inconsistencies are found
  1952. X.FL "\(ens" "List the superblock of the file system"
  1953. X.EX "fsck /dev/hd4" "Check file system on \fI/dev/hd4\fR"
  1954. X.EX "fsck \(ena /dev/at0" "Automatically fix errors on \fI/dev/at0\fR"
  1955. X.EX "fsck \(enl /dev/fd0" "List the contents of \fI/dev/fd0\fR"
  1956. X.EX "fsck \(enc 2 3 /dev/hd3" "Check and list \fI/dev/hd3\fR i-nodes 2 & 3"
  1957. X.PP
  1958. X\fIFsck\fR performs consistency checks on the file systems which reside 
  1959. Xon the specified devices.  
  1960. XWhen either the \fB\(ena\fR or \fB\(enr\fR flags are given, the file system
  1961. Xwill be repaired if errors are found.
  1962. XBefore running \fIfsck\fR on a mounted file system, it must first be unmounted.
  1963. XTrying to repair a mounted file system is dangerous and should not be 
  1964. Xattempted.
  1965. X.PP
  1966. XTo repair the root file system (which cannot be unmounted), first 
  1967. Xhit the F1 key to find the pid of the \fI/etc/update\fR process.
  1968. XThen become superuser and send \fIupdate\fR signal 9 using \fIkill\fR.
  1969. XAfter doing this, hit F1 again to verify that \fI/etc/update\fR has vanished.
  1970. XNext run \fIfsck\fR and then immediately reboot
  1971. Xthe computer, WITHOUT doing a \fIsync\fR.
  1972. X.PP
  1973. XThis is the only situation in which you can (in fact, must) reboot without
  1974. Xdoing a \fIsync\fR.
  1975. XRebooting is needed because \fIfsck\fR repairs the disk but does not affect
  1976. Xthe (possibly incorrect) information held in memory.
  1977. XDoing a \fIsync\fR would force the (possibly incorrect) information from
  1978. Xmemory back onto the disk, thus ruining the work done by \fIfsck\fR.
  1979. XBy rebooting immediately, memory is reloaded with correct information from the
  1980. Xdisk.
  1981. XIt is necessary to kill \fI/etc/update\fR before repairing the root file system
  1982. Xto prevent it from issuing \fIsync\fR calls while \fIfsck\fR is running.
  1983. XBecause \fI/etc/update\fR only affects mounted file systems (and the root),
  1984. Xwhen repairing a nonroot file system, unmounting it is sufficient; it is not
  1985. Xnecessary to kill \fI/etc/update\fR.
  1986. X
  1987. X
  1988. X
  1989. X.SP 1
  1990. /
  1991. echo x - gather
  1992. sed '/^X/s///' > gather << '/'
  1993. X.CD "gather \(en gather up the files in a directory for transmission"
  1994. X.SX "gather\fR [\fB\(ens\fR] \fIsource_dir [\fB\(end\fR] dest_dir\fR [\fB\(enb\fR] \fIbytes\fR [\fB\(enf\fR] \fIfile\fR 
  1995. X.FL "\(enb" "Desired number of bytes per output file"
  1996. X.FL "\(end" "Destination directory"
  1997. X.FL "\(enf" "Base name of output files"
  1998. X.FL "\(ens" "Source directory"
  1999. X.EX "gather" "Collect files in current dir into 60K archives"
  2000. X.EX "gather \(end dir" "Put the archives in \fIdir\fR
  2001. X.EX "gather \(enb 90000" "Try to produce 90K archives"
  2002. X.EX "gather \(ens .. \(end targ \(enb 5000" "Try to produce 5K archives"
  2003. X.PP
  2004. XIt is often useful to collect all the files in a directory into one or
  2005. Xmore archives for transmission by mail.  This program collects all the
  2006. Xfiles in the source directory (default: current directory) and puts
  2007. Xthem into a shar archive.  The shar archive is then compressed and
  2008. Xuuencoded.  An attempt is made to have the final \fI.uue\fR file be
  2009. Xabout the given size (default: 60K), but since \fIgather\fR cannot really
  2010. Xpredict how much \fIshar\fR will add to the file, how much \fIcompress\fR
  2011. Xwill reduce the file, and how much \fIuue\fR will add again, the sizes
  2012. Xcan fluctuate.  If the \fB\(enf \fIfile\fR flag is given, the archives will
  2013. Xbe given the names \fIfile_00.uue\fR, \fIfile_01.uue\fR etc.  If \fB\(enf\fR
  2014. Xis not given, the name of the source directory is used as the base name.
  2015. XSince 7 characters of suffix are appended, the base name should not exceed
  2016. X7 characters.
  2017. X
  2018. X
  2019. X
  2020. X.SP -0.5
  2021. /
  2022. echo x - getlf
  2023. sed '/^X/s///' > getlf << '/'
  2024. X.CD "getlf \(en wait until a line has been typed"
  2025. X.SX "getlf\fR [\fIargument\fR]"
  2026. X.FL "\fR(none)"
  2027. X.EY "getlf" "Wait for a line"
  2028. X.PP
  2029. XIn shell scripts it is sometimes necessary to pause to give the user a
  2030. Xchance to perform some action, such as inserting a diskette.
  2031. XThis command prints its argument, if any,
  2032. Xand then waits until a carriage return has been typed, at which
  2033. Xtime it terminates.
  2034. XIt is used in
  2035. X.I /etc/rc .
  2036. X.SP -0.5
  2037. X
  2038. X
  2039. /
  2040. echo x - getty
  2041. sed '/^X/s///' > getty << '/'
  2042. X.CD "getty \(en get terminal line parameters for login"
  2043. X.SX "getty\fI line \fR[\fB\(enc \fIfile\fR] [\fB\(enh\fR] [\fB\(enk\fR] [\fB\(ent\fR] [\fIspeed\fR]
  2044. X.FL "\(enc" "Use \fIfname\fR as \fIgettydefs\fR file"
  2045. X.FL "\(enh" "Do not hang up the phone after reset"
  2046. X.FL "\(enk" "Do not use speed selection"
  2047. X.FL "\(ent" "Do not time out at \fILogin:\fR prompt"
  2048. X.EY "/etc/getty /dev/tty1 1200" "Connect to \fItty1 at 1200 baud\fR"
  2049. X.PP
  2050. XThe \fIgetty\fR program allows a terminal port to be used for both dialin and
  2051. Xdialout. It also detects the speed used, and, if enabled, it sets the
  2052. Xvarious line discipline parameters.
  2053. XWhen \fIgetty\fR starts up, it searches through the \fI/etc/gettydefs\fR
  2054. Xfile until it finds an entry that matches the label as specified in the
  2055. X\fIspeed\fR parameter. 
  2056. XIf no paramater is present, the first entry is used. \fIGetty\fR
  2057. Xthen sets up the terminal line according to the initial parameters
  2058. Xfield found in \fIgettydefs\fR.
  2059. X
  2060. X
  2061. X
  2062. X.SP 1
  2063. /
  2064. echo x - grep
  2065. sed '/^X/s///' > grep << '/'
  2066. X.CD "grep \(en search a file for lines containing a given pattern"
  2067. X.SX "grep\fR [\fB\(enelnsv\fR] \fIpattern\fR [\fIfile\fR] ..."
  2068. X.FL "\(ene" "\fB\(ene \fIpattern\fR is the same as \fIpattern\fP
  2069. X.FL "\(enl" "Do not print line numbers"
  2070. X.FL "\(enn" "Print line numbers"
  2071. X.FL "\(ens" "Status only, no printed output"
  2072. X.FL "\(env" "Select lines that do not match"
  2073. X.EX "grep mouse file " "Find lines in \fIfile\fP containing \fImouse\fP"
  2074. X.EX "grep [0\(en9] file" "Print lines containing a digit"
  2075. X.PP
  2076. X.I Grep
  2077. Xsearches one or more files (by default, \fIstdin\fR) and selects out
  2078. Xall the lines that match the pattern.
  2079. XAll the regular expressions accepted by
  2080. X.I ed
  2081. Xand
  2082. X.I mined 
  2083. Xare allowed.
  2084. XIn addition, + can be used instead of \(** to mean 1 or more occurrences,
  2085. X? can be used to mean 0 or 1 occurrences, and
  2086. X| can be used between two regular expressions to mean either
  2087. Xone of them.
  2088. XParentheses can be used for grouping.
  2089. XIf a match is found, exit status 0 is returned.
  2090. XIf no match is found, exit status 1 is returned.
  2091. XIf an error is detected, exit status 2 is returned.
  2092. X
  2093. X
  2094. X
  2095. /
  2096. echo x - gres
  2097. sed '/^X/s///' > gres << '/'
  2098. X.CD "gres \(en grep and substitute"
  2099. X.SX "gres\fR [\fB\(eng\fR] \fIpattern \fIstring\fR [\fIfile\fR] ..."
  2100. X.FL "\(eng" "Only change the first occurrence per line"
  2101. X.EX "gres bug insect" "Replace \fIbug\fP with \fIinsect\fP"
  2102. X.EX "gres \*(SQ^[A\(enZ]+$\*(SQ CAPS" "Replace capital-only lines with \fICAPS\fP"
  2103. X.PP
  2104. X.I Gres
  2105. Xis a poor man's
  2106. X.I sed .
  2107. XIt looks for the same patterns as
  2108. X.I grep ,
  2109. Xand replaces each one by the given string.
  2110. X
  2111. X
  2112. X
  2113. X.SP 1.5
  2114. /
  2115. echo x - hdclose
  2116. sed '/^X/s///' > hdclose << '/'
  2117. X.CD "hdclose \(en close hard disk partition [MACINTOSH]"
  2118. X.SX "hdclose \fIdevice\fR"
  2119. X.FL "\fR(none)"
  2120. X.EX "hdclose /dev/hd3" "Disconnect \fIhd3\fR from its current Macintosh file"
  2121. X.PP
  2122. X.I Hdclose
  2123. Xwill disconnect the current Macintosh file from the given hard disk
  2124. Xpartition.  See also \fIhdopen\fR.  You \fBmust\fR unmount the file system
  2125. X\fBbefore\fR you close it.
  2126. X
  2127. X
  2128. X
  2129. X.SP 1.5
  2130. /
  2131. echo x - hdopen
  2132. sed '/^X/s///' > hdopen << '/'
  2133. X.CD "hdopen \(en set correspondence of a HD partition [MACINTOSH]"
  2134. X.SX "hdopen \fIvol:dir:file\fR \fIdevice\fR"
  2135. X.FL "\fR(none)"
  2136. X.EX "hdopen vol:dir:file /dev/hd3" "Set \fIhd3\fR to Macintosh file \fIfile\fR"
  2137. X.PP
  2138. X.I Hdopen
  2139. Xwill set up a correspondence between the given Macintosh file and
  2140. Xa
  2141. X.MX
  2142. Xhard disk partition.  On the Macintosh,
  2143. X.MX
  2144. Xhard disk partitions are nothing more than a standard Macintosh file.
  2145. XThis program will set the given hard disk partition to the given file.
  2146. XIf a file is already associated with that partition, you must first use
  2147. X\fIhdclose\fR.
  2148. X
  2149. X
  2150. X
  2151. /
  2152. echo x - head
  2153. sed '/^X/s///' > head << '/'
  2154. X.CD "head \(en print the first few lines of a file"
  2155. X.SX "head\fR [\fB\(en\fIn\fR]\fR [\fIfile\fR] ..."
  2156. X.FL "\(en\fIn\fR" "How many lines to print"
  2157. X.EX "head \(en6" "Print first 6 lines of \fIstdin\fR"
  2158. X.EX "head \(en1 file1 file2" "Print first line of two files"
  2159. X.PP
  2160. XThe first few lines of one or more files are printed.
  2161. XThe default count is 10 lines.
  2162. XThe default file is \fIstdin\fR.
  2163. X
  2164. X
  2165. X
  2166. X.SP 1.5
  2167. /
  2168. echo x - ic
  2169. sed '/^X/s///' > ic << '/'
  2170. X.CD "ic \(en integer calculator"
  2171. X.SX "ic\fR [\fIexpression\fR]"
  2172. X.FL "\fR(none)"
  2173. X.EX "ic~~~~" "Start the calculator"
  2174. X.EX "ic 250 300+" "Start calculator with 550 on the stack"
  2175. X.PP
  2176. X\fIIc\fR is a reverse Polish notation calculator that works on 32-bit integers.
  2177. XIt starts out by computing the expression given as an argument, if any, and
  2178. Xthen expects keyboard input.  As an example, to compute \*(OQ23+5\*(CQ one 
  2179. Xfirst converts this to reverse Polish, \*(OQ23 5+\*(CQ. 
  2180. XAfter the calculator starts, type \*(OQ23\*(CQ followed by a carriage return.
  2181. XThen type \*(OQ5\*(CQ and another carriage return.
  2182. XFinally type \*(OQ+\*(CQ to see the result, 28 displayed on the stack.
  2183. XOther operations work the same way.  The calculator can use other radices for
  2184. Xinput and output, and has registers that can be stored and loaded.  The \fIh\fR
  2185. Xcommand gives the help menu.  See also Chap. 9.
  2186. X
  2187. X
  2188. X
  2189. X.SP 0.4
  2190. /
  2191. echo x - id
  2192. sed '/^X/s///' > id << '/'
  2193. X.CD "id \(en print the uid and gid"
  2194. X.SX "id"
  2195. X.FL "\fR(none)"
  2196. X.EY "id" "Print the uid and gid"
  2197. X.PP
  2198. X\fIId\fR prints the current uid and gid, both numerically and symbolically.
  2199. XIf the effective uid and gid are different from the real ones, all of them
  2200. Xare printed.
  2201. X
  2202. X
  2203. X
  2204. X.SP 0.4
  2205. /
  2206. echo x - ifdef
  2207. sed '/^X/s///' > ifdef << '/'
  2208. X.CD "ifdef \(en remove #ifdefs from a file"
  2209. X.SX "ifdef \fR[\fB\(ent\fR] [\fB\(end\fIsymbol\fR] [\fB\(enD\fIsymbol\fR] [\fB\(enU\fIsymbol\fR] [\fB\(enI\fIsymbol\fR] [file]"
  2210. X.FL "\(enD" "Define symbol permanently"
  2211. X.FL "\(enI" "Ignore symbol"
  2212. X.FL "\(enU" "Undefine symbol permanently"
  2213. X.FL "\(end" "Define symbol. It may be #undef'ed later"
  2214. X.FL "\(ent" "Produce a table of the symbols on \fIstdout\fR"
  2215. X.EX "ifdef \(enDUNIX file.c >newfile.c" "Define \fIUNIX\fR"
  2216. X.EX "ifdef \(enD_MINIX \(enUDOS <x.c >y.c "Define \fI_MINIX\fR, undefine \fIDOS\fR"
  2217. X.PP
  2218. X\fIIfdef\fR
  2219. Xallows conditional code [ #ifdef ... #endif ]
  2220. Xto be selectively removed from C files, but at the same time leaving
  2221. Xall other C preprocessor commands intact such as #define, #include etc.
  2222. XInput to
  2223. X.I ifdef
  2224. Xis either the file named as the last argument, or \fIstdin\fR if no file
  2225. Xis named.
  2226. XOutput goes to \fIstdout\fR.
  2227. X.PP
  2228. XSymbols may be defined with the \fB\(end\fR or \fB\(enD\fR flags just like
  2229. X\fIcpp\fR, except that the latter option ignores subsequent \fI#undefs\fR.
  2230. XIt is not permitted to give values to symbols.
  2231. XSimilarly, \fB\(enU\fR undefines a symbol and ignores subsequent 
  2232. X\fI#defines\fRs.
  2233. XSymbols defined with \fB\(enI\fR are ignored; any \fI#ifdef\fR using an
  2234. Xignored symbol will be left intact.
  2235. X
  2236. X
  2237. X
  2238. /
  2239. echo x - indent
  2240. sed '/^X/s///' > indent << '/'
  2241. X.CD "indent \(en reformat the layout of a program"
  2242. X.SX "indent \fIin_file\fR [\fIout_file\fR] [\fIoptions\fR]
  2243. X.FL "\fR(many)"
  2244. X.EX "indent \(enbr \(enc25 prog.c " "Indent \fIprog.c\fR
  2245. X.EX "indent \(ennpcs prog.c newprog.c" "Put output on \fInewprog.c"
  2246. X.PP
  2247. X\fIIndent\fR reformats a C program according to a set of options provided.
  2248. XMost of the common choices are available.
  2249. XThe output file replaces the input file, unless an explicit output file
  2250. Xis specified (but a backup is made of the original with suffix \fI.BAK\fR).
  2251. XThe options are given in Chap. 9.
  2252. X
  2253. X
  2254. X
  2255. /
  2256. echo x - inodes
  2257. sed '/^X/s///' > inodes << '/'
  2258. X.CD "inodes \(en print i-node information"
  2259. X.SX "inodes"
  2260. X.FL "\fR(none)"
  2261. X.EX "inodes" "Print information about file names typed in"
  2262. X.EX "cd /dev; ls | inodes" "Print information about the special files"
  2263. X.PP
  2264. X\fIInodes\fR expects a list of file names on \fIstdin\fR, one file name
  2265. Xper line.
  2266. XFor each file named, the file type, mode, uid, gid, checksum, length,
  2267. Xand name is printed.
  2268. XThe checksum is the same as used by \fIcrc\fR.
  2269. XThis program provides a way to see the sizes of the block special
  2270. Xfiles in \fI/dev\fR, as shown in the second example above.
  2271. X
  2272. X
  2273. X
  2274. /
  2275. echo x - kermit
  2276. sed '/^X/s///' > kermit << '/'
  2277. X.CD "kermit \(en transfer a file using the kermit protocol"
  2278. X.SX "kermit"
  2279. X.FL "\fR(many)"
  2280. X.EY "kermit" "Start kermit"
  2281. X.PP
  2282. X\fIKermit\fR is a file transfer program, remote connection program, and
  2283. Xmuch more.
  2284. XEven summarizing it here would be out of the question.
  2285. XFor a description of it, see the 379 page book 
  2286. X\fIKermit: A File Transfer Protocol\fR
  2287. Xby Frank da Cruz, Digital Press, 1987, ISBN 0-932376-88-6, and also
  2288. XChap. 9.
  2289. X
  2290. X
  2291. X
  2292. /
  2293. echo x - kill
  2294. sed '/^X/s///' > kill << '/'
  2295. X.CD "kill \(en send a signal to a process"
  2296. X.SX "kill\fR [\fB\(en\fIn\fR] \fIprocess"
  2297. X.FL "\(en\fIn\fR" "Signal number to send"
  2298. X.EX "kill 35" "Send signal 15 to process 35"
  2299. X.EX "kill \(en9 40" "Send signal 9 to process 40"
  2300. X.EX "kill \(en2 0" "Send signal 2 to whole process group"
  2301. X.PP
  2302. XA signal is sent to a given process.
  2303. XBy default signal 15 (SIGTERM) is sent.
  2304. XProcess 0 means all the processes in the sender's process group.
  2305. X
  2306. X
  2307. X
  2308. /
  2309. echo x - last
  2310. sed '/^X/s///' > last << '/'
  2311. X.CD "last \(en display recent on-line session records"
  2312. X.SX "last\fR [\fB\(enf \fIfile\fR]\fR [\fB\(enr\fR] [\fB\(en\fIn\fR] [\fIname\fR] [\fItty\fR] ..."
  2313. X.FL "\(enf" "Use \fIfile\fR instead of /usr/adm/wtmp"
  2314. X.FL "\(enr" "Search backwards only to last reboot"
  2315. X.FL "\(en\fIn\fP" "Print a maximum of \fIn\fR lines"
  2316. X.EX "last reboot" "When was the system last rebooted?"
  2317. X.EX "last ast" "When was the last login for ast?"
  2318. X.EX "last \(en10 tty0 tty1" "Display last 10 logins on tty0 or tty1"
  2319. X.PP
  2320. X.I Last
  2321. XSearches backward through the login administration file (default is
  2322. X\fI/usr/adm/wtmp\fR), printing information about previous logins and
  2323. Xreboots.
  2324. XDuring a long search, the SIGQUIT signal (CTRL-\\) causes \fIlast\fR to 
  2325. Xdisplay how far back it has gone; it then continues. 
  2326. X
  2327. X
  2328. X
  2329. /
  2330. echo x - leave
  2331. sed '/^X/s///' > leave << '/'
  2332. X.CD "leave \(en warn when it is time to go home"
  2333. X.SX "leave\fR [\fR [\fB+\fR] \fIhh\fR[\fB:\fR]\fImm\fR]"
  2334. X.FL "\fR(none)"
  2335. X.EX "leave 1500" "Issue a warning at 2:55 p.m."
  2336. X.EX "leave 10:00" "Issue a warning at 9:55 a.m."
  2337. X.EX "leave + 30" "Issue a warning in 25 minutes"
  2338. X.PP
  2339. X\fILeave\fR sets an alarm clock to a specified time and issues a warning
  2340. X5 minutes before, 1 minute before, and at the time to leave.
  2341. XIt then keeps issuing warnings every minute for 10 minutes, then quits.
  2342. XIf no time is provided, the program prompts for one.
  2343. X
  2344. X
  2345. X
  2346. X.SP -0.5
  2347. /
  2348. echo x - libpack
  2349. sed '/^X/s///' > libpack << '/'
  2350. X.CD "libpack \(en pack an ASCII assembly code file [IBM]"
  2351. X.SX "libpack"
  2352. X.FL "\fR(none)"
  2353. X.EY "libpack <x.s >y.s" "Pack \fIx.s\fP"
  2354. X.PP
  2355. XThis program is a filter that reads an ASCII assembly code file from standard
  2356. Xinput and writes the corresponding packed file on standard output.
  2357. XThe compiler libraries are archives of packed assembly code files.
  2358. X.SP -0.5
  2359. X
  2360. X
  2361. X
  2362. /
  2363. echo x - libupack
  2364. sed '/^X/s///' > libupack << '/'
  2365. X.CD "libupack \(en convert a packed assembly code file to ASCII [IBM]"
  2366. X.SX "libupack"
  2367. X.FL "\fR(none)"
  2368. X.EY "libupack <y.s >x.s" "Unpack \fIy.s\fP"
  2369. X.PP
  2370. XThis program is a filter that reads a packed assembly code file
  2371. Xfrom \fIstdin\fR and writes the corresponding ASCII file on standard output.
  2372. X
  2373. X
  2374. X
  2375. /
  2376. echo x - ln
  2377. sed '/^X/s///' > ln << '/'
  2378. X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
  2379. X.CD "ln \(en create a link to a file"
  2380. X.SX "ln [\fB\(enf\fR] \fIfile\fR [\fIname\fR]
  2381. X.SX "ln [\fB\(enf\fR] \fIfile\fR ... \fIdir\fR
  2382. X.FL "\(enf" "Remove existing links"
  2383. X.EX "ln file newname" "Make \fInewname\fP a synonym for \fIfile\fP"
  2384. X.EX "ln /usr/games/chess" "Create a link called \fIchess\fP"
  2385. X.PP
  2386. XA directory entry is created for
  2387. X.I name .
  2388. XThe entry points to
  2389. X.I file .
  2390. XHenceforth,
  2391. X.I name
  2392. Xand
  2393. X.I file
  2394. Xcan be used interchangeably.
  2395. XIf
  2396. X.I name
  2397. Xis not supplied, the last component of
  2398. X.I file
  2399. Xis used as the link name.
  2400. XIf more than one
  2401. X.I file
  2402. Xis supplied or the
  2403. X.I name
  2404. Xrefers to an existing directory, links will be created in that directory.
  2405. XAn existing
  2406. X.I name
  2407. Xwill not be removed unless the \fB\(enf\fR flag is specified.
  2408. X
  2409. X
  2410. X
  2411. /
  2412. echo x - login
  2413. sed '/^X/s///' > login << '/'
  2414. X.CD "login \(en log into the computer"
  2415. X.SX "login\fR [\fIuser\fR]"
  2416. X.FL "\fR(none)"
  2417. X.EY "login ast" "Login as ast"
  2418. X.PP
  2419. X\fILogin\fR allows a logged in user to login as someone else without first
  2420. Xlogging out.
  2421. XIf a password is needed, \fIlogin\fR will prompt for it.
  2422. X
  2423. X
  2424. X
  2425. X.SP 1.6
  2426. /
  2427. echo x - look
  2428. sed '/^X/s///' > look << '/'
  2429. X.CD "look \(en look up words in dictionary"
  2430. X.SX "look\fR [\fB\(enf\fR] \fIprefix\fR[\fB/\fIsuffix\fR]\fR [\fIdictionary\fR]"
  2431. X.FL "\(enf" "Fold upper case letters to lower case"
  2432. X.EX "look ard" "Print words starting with \fIard\fR"
  2433. X.EX "look /bing" "Print words ending with \fIbing\fR"
  2434. X.EX "look \(enf f/ar" "Print words starting with \fIf\fR, ending with \fIar\fR"
  2435. X.PP
  2436. X\fILook\fR takes a prefix and/or suffix and searches \fI/usr/lib/dictionary\fR
  2437. Xor the specified dictionary for all words with that match.
  2438. XThe words are printed.
  2439. XThe \fB\(enf\fR flag causes all upper case letters to be treated as lower
  2440. Xcase.
  2441. X
  2442. X
  2443. X
  2444. X.SP 1.6
  2445. /
  2446. echo x - lorder
  2447. sed '/^X/s///' > lorder << '/'
  2448. X.CD "lorder \(en compute the order for library modules [IBM]"
  2449. X.SX "lorder \fIfile ..."
  2450. X.FL "\fR(none)"
  2451. X.EY "lorder proc1.s proc2.s" "Give \fIlorder\fR information"
  2452. X.PP
  2453. X\fILorder\fR accepts a series of packed or unpacked \fI.s\fR files and 
  2454. Xlibraries, and produces a partial ordering suitable for processing by 
  2455. X\fItsort\fR.
  2456. X
  2457. X
  2458. X
  2459. /
  2460. echo x - lpr
  2461. sed '/^X/s///' > lpr << '/'
  2462. X.CD "lpr \(en copy a file to the line printer"
  2463. X.SX "lpr\fR [\fIfile\fR] ..."
  2464. X.FL "\fR(none)"
  2465. X.EX "lpr file &" "Print \fIfile\fP on the line printer"
  2466. X.EX "pr file | lpr &" "Print \fIstdin\fR (\fIpr\fR's output)"
  2467. X.PP
  2468. XEach argument is interpreted as a file to be printed.
  2469. X.I Lpr
  2470. Xcopies each file to 
  2471. X.I /dev/lp ,
  2472. Xwithout spooling.
  2473. XIt inserts carriage returns and expands tabs.
  2474. XOnly one
  2475. X.I lpr
  2476. Xat a time may be running.
  2477. X
  2478. X
  2479. X
  2480. X.SP 1
  2481. /
  2482. echo x - ls
  2483. sed '/^X/s///' > ls << '/'
  2484. X.CD "ls \(en list the contents of a directory"
  2485. X.SX "ls\fR [\fB\(enabcdfgilmnopqrstux01ACFLRS\fR]\fR [\fIname\fR] ...
  2486. X.FL "\(enA" "All entries are listed, except \fI.\fR and \fI..\fR"
  2487. X.FL "\(enC" "Multicolumn listing with entries sorted down the page"
  2488. X.FL "\(enF" "Put /, | and * after directories, fifos and executables"
  2489. X.FL "\(enL" "Print information about symbolic links"
  2490. X.FL "\(enR" "Recursively list subdirectories"
  2491. X.FL "\(enS" "Squeeze column widths in multicolumn listings"
  2492. X.FL "\(ena" "List all entries including those starting with \fI.\fR"
  2493. X.FL "\(enb" "Print non-graphic characters in octal \\ddd notation"
  2494. X.FL "\(enc" "Use the status change time instead of modification time"
  2495. X.FL "\(end" "Do not list contents of directories"
  2496. X.FL "\(enf" "List argument as unsorted directory"
  2497. X.FL "\(eng" "As for \(enl, but print the group only"
  2498. X.FL "\(eni" "I-node number printed in first column"
  2499. X.FL "\(enl" "Long listing: mode, links, owner, group, size and time"
  2500. X.FL "\(enm" "Stream output format"
  2501. X.FL "\(enn" "As for \(enl, but print numeric uid and gid"
  2502. X.FL "\(eno" "As for \(enl, but print the owner only"
  2503. X.FL "\(enp" "Put / after directory names"
  2504. X.FL "\(enq" "Print ? in place of non-graphic characters"
  2505. X.FL "\(enr" "Reverse the sort order"
  2506. X.FL "\(ens" "Print the size in 512 byte units"
  2507. X.FL "\(ent" "Sort by time, latest first"
  2508. X.FL "\(enu" "Use last usage time instead of modification time"
  2509. X.FL "\(enx" "Multicolumn listing with entries sorted across the page"
  2510. X.FL "\(en0" "Reset all options"
  2511. X.FL "\(en1" "Print one entry per line (default)"
  2512. X.EX "ls \(enl~~" "List files in working directory"
  2513. X.EX "ls \(enlis" "List with i-nodes and sizes"
  2514. XFor each file argument, list it.
  2515. XFor each directory argument, list its contents, unless \fB\(end\fR is present.
  2516. XWhen no argument is present, the working directory is listed.
  2517. /
  2518.