home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-07 | 97.5 KB | 2,894 lines |
- echo x - m4
- sed '/^X/s///' > m4 << '/'
- X.CD "m4 \(en macro processor"
- X.SX "m4\fR [\fB\(enD \fIname\fR = \fIvalue\fR]\fR [\fB\(enU \fIname\fR]
- X.FL "\(enD" "Define a symbol"
- X.FL "\(enU" "Undefine a symbol"
- X.EY "m4 <m4test" "Run M4"
- X.PP
- X\fIM4\fR is a general-purpose macro processor.
- XIt is described in Chap. 9.
- XIt has been used to implement programming languages, such as RATFOR.
- X
- X
- X
- /
- echo x - maccreate
- sed '/^X/s///' > maccreate << '/'
- X.CD "maccreate \(en create an empty macintosh file [MACINTOSH]"
- X.SX "maccreate \fInblocks\fR \fIfile\fR"
- X.FL "\fR(none)"
- X.EX "maccreate 512 vol:dir:file" "Create a 512K file"
- X.PP
- X.I Maccreate
- Xwill create a Macintosh file that can serve as a
- X.MX
- Xdisk partition. Also see the descriptions of hdopen and hdclose.
- X
- X
- X
- /
- echo x - macfile
- sed '/^X/s///' > macfile << '/'
- X.CD "macfile \(en list, read and write Macintosh volumes [MACINTOSH]"
- X.SX "macfile\fR [\fB\(enRadlrw\fR] [\fIfile\fR]"
- X.FL "\(enR" "Recursively descend directories when listing them"
- X.FL "\(ena" "Read or write ASCII file"
- X.FL "\(end" "Directory list"
- X.FL "\(enl" "Use long format for directory listing"
- X.FL "\(enr" "Read a \s-2Macintosh\s0 file into \s-2MINIX\s0"
- X.FL "\(enw" "Write a \s-2MINIX\s0" file to a \s-2Macintosh\s0 volume"
- X.EX "macfile \(endl" "List mounted volumes"
- X.EX "macfile \(endl vol:dir" "Long listing of the specified directory"
- X.EX "macfile \(enr dir:file >adv" "Read file \fIfile\fR into adv"
- X.EX "macfile \(enwa f" "Copy ASCII \fIstdin\fR to file \fIf\fR"
- X.PP
- X.I Macfile
- Xuses the Macintosh ROM to transfer files between the
- Xnormal Macintosh operating system and \s-2MINIX\s0.
- XIt can list volumes, directories and read and write files.
- XWhen the ASCII flag is specified, the
- X.MX
- Xnew line character is mapped onto
- Xthe Macintosh line feed character.
- X.I Macfile
- Xmay be linked to
- X.I macdir ,
- X.I macread
- Xand
- X.I macwrite ,
- Xin which case the \fB\(end\fR, \fB\(enr\fR, and \fB\(enw\fR flags are not
- Xneeded.
- X
- X
- X
- X.SP -0.5
- /
- echo x - macread
- sed '/^X/s///' > macread << '/'
- X.CD "macread \(en read a Macintosh file [MACINTOSH]"
- X.SX "macread\fR [\fB\(ena\fR] \fIfile\fR"
- X.EX "macread dir:file >adv" "Copy file \fIfile\fR into adv"
- X.EX "macread \(ena dir:file >adv" "Copy ascii file \fIfile\fR onto stdout"
- X.FL "\(ena" "Read an ASCII file"
- X.PP
- X.I Macread
- Xuses the Macintosh ROM to copy a
- XMacintosh operating system file to standard output.
- XWhen the ASCII flag is specified, the
- XMacintosh line feed character
- Xis mapped onto
- Xthe
- X.MX
- Xnew line character.
- X.I Macread
- Xis a link to
- X.I macfile.
- X
- X
- X
- X.SP -0.5
- /
- echo x - macros
- sed '/^X/s///' > macros << '/'
- X.de CD
- X.ne 2
- X.if t .ta 0.9i 1.15i 2.75i 3.25i 3.75i
- X.if n .ta 11m 15m 40m
- X.nr x 0 0
- X.nr y 0 0
- X.nr z 0 0
- X.if n #\\$1
- X.if n .br
- X\\fBCommand:\& \\$1\\fR
- X.br
- X..
- X.de SX
- X.if \\nx<=0 \\fBSyntax:\& \\$1
- X.if \\nx>0 \& \\fB\\$1
- X.nr x 1 1
- X.br
- X..
- X.de FL
- X.if \\ny<=0 \\fBFlags:\& \\fB\\$1 \\fR\\$2
- X.if \\ny>0 \& \\fB\\$1 \\fR\\$2
- X.nr y 1 1
- X.br
- X..
- X.de EX
- X.br
- X.nf
- X.if \\nz<=0 \\fB\&Examples: \\fR\\$1 \\fR# \\$2
- X.if \\nz>0 \& \\fR\\$1 \\fR# \\$2
- X.nr z 1 1
- X.br
- X..
- X.de EY
- X.br
- X.nf
- X.if \\nz<=0 \\fB\&Example: \\fR\\$1 \\fR# \\$2
- X.if \\nz>0 \& \\fR\\$1 \\fR# \\$2
- X.nr z 1 1
- X.br
- X..
- X
- /
- echo x - macwrite
- sed '/^X/s///' > macwrite << '/'
- X.CD "macwrite \(en write a Macintosh file [MACINTOSH]"
- X.SX "macwrite\fR [\fB\(ena\fR] \fIfile\fR"
- X.EX "macwrite dir:file <adv" "Copy file adv to mac file \fIfile\fR"
- X.EX "macwrite \(ena dir:file" "Copy stdin to mac file \fIfile\fR"
- X.FL "\(ena" "Write an ASCII file"
- X.PP
- X.I Macwrite
- Xuses the Macintosh ROM to copy standard input into the
- Xthe named Macintosh file.
- XWhen the ASCII flag is specified, the
- X.MX
- Xnew line character
- Xis mapped onto the
- XMacintosh line feed character.
- XThe file is created if it doesn't exist, or is overwritten if it does.
- XOnce the file is written you can set the type and creator
- Xflags with the \fIsettype\fR command.
- X.I Macwrite
- Xis a link to
- X.I macfile.
- X
- X
- X
- X.SP 1
- /
- echo x - mail
- sed '/^X/s///' > mail << '/'
- X.CD "mail \(en send and receive electronic mail"
- X.SX "mail\fR [\fB\(endpqrv\fR]\fR [\fB\(enf \fIfile\fR] [\fIuser\fR]
- X.FL "\(end" "Force use of the shell variable \fIMAILER\fR"
- X.FL "\(enf" "Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox"
- X.FL "\(enp" "Print all mail and then exit"
- X.FL "\(enq" "Quit program if SIGINT received"
- X.FL "\(enr" "Reverse print order, i.e., print oldest first"
- X.FL "\(env" "Verbose mode"
- X.EX "mail ast" "Send a message to \fIast\fR"
- X.EX "mail" "Read your mail"
- X.PP
- X\fIMail\fR is an extremely simple electronic mail program. It can be used
- Xto send or receive email on a single
- X.MX
- Xsystem, in which case it functions
- Xas user agent and local delivery agent.
- XIf the flag \fIMAILER\fR is defined in \fImail.c\fR,
- Xit can also call a trans\%port agent to handle remote mail as well.
- XNo such agent is supplied with
- X.MX .
- X.PP
- XWhen called by \fIuser\fR with no arguments, it examines the mailbox
- X\fI/usr/spool/mail/user\fR, prints one message (depending on the \fB\(enr\fR
- Xflag), and waits for one of the following commands:
- X.SP 1
- X.HS
- X.nf
- X.ta 0.25i 1.25i
- X <newline> Go to the next message
- X \(en Print the previous message
- X !command Fork off a shell and execute \fIcommand\fR
- X CTRL-D Update the mailbox and quit (same as q)
- X d Delete the current message and go to the next one
- X q Update the mailbox and quit (same as CTRL-D)
- X p Print the current message again
- X s [\fIfile\fR] Save message in the named file
- X x Exit without updating the mailbox
- X.HS
- X.PP
- X.SP 1
- XTo send mail, the program is called with the name of the recipient as an
- Xargument. The mail is sent, along with a postmark line containing the date.
- XFor local delivery, a file named after the recipient in the directory
- X\fI/usr/spool/mail\fR must be writable.
- X
- X
- X
- /
- echo x - make
- sed '/^X/s///' > make << '/'
- X.CD "make \(en a program for maintaining large programs"
- X.SX "make\fR [\fB\(enf \fIfile\fR]\fR [\fB\(eniknpqrst\fR] [\fIoption\fR] ... [\fItarget\fR]
- X.FL "\(enf" "Use \fIfile\fP as the makefile"
- X.FL "\(eni" "Ignore status returned by commands"
- X.FL "\(enk" "On error, skip to next command"
- X.FL "\(enn" "Report, but do not execute"
- X.FL "\(enp" "Print macros and targets"
- X.FL "\(enq" "Question up-to-dateness of target"
- X.FL "\(enr" "Rule inhibit; do not use default rules"
- X.FL "\(ens" "Silent mode"
- X.FL "\(ent" "Touch files instead of making them"
- X.EX "make kernel" "Make \fIkernel\fP up to date"
- X.EX "make \(enn \(enf mfile" "Tell what needs to be done"
- X.PP
- X.I Make
- Xis a program that is normally used for developing large programs consisting of
- Xmultiple files.
- XIt keeps track of which object files depend on which source and header files.
- XWhen called, it does the minimum amount of recompilation to bring the target
- Xfile up to date.
- X.PP
- XThe file dependencies are expected in
- X.I makefile
- Xor
- X.I Makefile ,
- Xunless another file is specified with \fB\(enf\fR.
- X.I Make
- Xhas some default rules built in, for example, it knows how to make
- X.I .s
- Xfiles
- Xfrom
- X.I .c
- Xfiles.
- XHere is a sample
- X.I makefile .
- X.HS
- X.nf
- X.ta 0.25i 1.0i 3.0i
- X d=/user/ast # \fId\fP is a macro
- X program: head.s tail.s # \fIprogram\fR depends on these
- X cc \(eno program head.s tail.s # tells how to make \fIprogram\fP
- X echo Program done. # announce completion
- X head.s: $d/def.h head.c # \fIhead.s\fP depends on these
- X.br
- X tail.s: $d/var.h tail.c # \fItail.s\fP depends on these
- X.HS
- X.fi
- XA complete description of \fImake\fR would require too much space here.
- XMany books on
- X.UX
- Xdiscuss
- X.I make .
- XStudy the numerous \fIMakefiles\fR in the
- X.MX
- Xsource tree for examples.
- X
- X
- X
- /
- echo x - man
- sed '/^X/s///' > man << '/'
- X.CD "man \(en display manual page"
- X.SX "man\fR [\fIman_directory\fR]\fR [\fIdigit\fR] [\fIname\fR] ...
- X.FL "\fR(none)"
- X.EX "man" "Display main index"
- X.EX "man cdiff" "Display man page for \fIcdiff\fR program"
- X.EX "man 2 fork" "Display man page for \fIfork\fR system call"
- X.EX "man 3" "Display the part 3 man pages"
- X.PP
- X\fIMan\fR is a program that displays manual pages.
- XWhen called with a program name, it displays the manual page for that
- Xprogram.
- XWhen the digit \fIk\fR is given as an argument, the file \fI/usr/man/man\fRk
- Xis used instead of the default, \fI/usr/man/man1\fR.
- XWhen no name is given (or just a digit), the list of valid entries is
- Xdisplayed.
- XThe arrows can be used to select an entry, and <return> can be used to
- Xdisplay the selected entry.
- X\fIQ\fR or \fIq\fR leaves the program.
- XA directory name can be given to override the use of \fI/usr/man\fR.
- XSince all the manual pages are provided in printed format, to save diskette
- Xspace, no manual pages are provided on diskette.
- XThus \fIman\fR is primarily useful for your own documentation.
- X
- X
- X
- X.SP 1
- /
- echo x - master
- sed '/^X/s///' > master << '/'
- X.CD "master \(en control the creation of shervers [IBM]"
- X.SX "master \fIcount \fIuid \fIgid \fIcommand"
- X.FL "\fR(none)"
- X.EY "master 2 1 1 /bin/sherver port" "Start 2 shervers"
- X.PP
- XIf a machine is intended to be used as a server, its \fI/etc/rc\fR
- Xfile should
- Xhave a command similar to the example above. When the system is booted,
- X\fImaster\fR runs and forks off the required number of shervers (shell
- Xservers), up to a maximum of four.
- XThey run with the indicated uid and gid, and listen to the indicated port.
- XWhen an \fIrsh\fR is done
- Xon a client machine, the command is given to one of the shervers for execution.
- XWhen the sherver is done, it exits, \fImaster\fR, which is always running,
- Xsees this,
- Xand creates a new sherver.
- XThus \fImaster\fR is analogous to \fIinit\fR, only it makes
- Xnew shervers (usually) instead of new \fIlogin\fR programs.
- X\fIMaster\fR must run as root to be able to do setuid and setgid.
- X
- X
- X.SP 1
- /
- echo x - mdb
- sed '/^X/s///' > mdb << '/'
- X.CD "mdb \(en Minix debugger [68000]"
- X.SX "mdb \fIexecutable\fR"
- X.FL "\fR(none)"
- X.EY "mdb /usr/bin/ls" "Invoke the debugger on the \fIls\fR program"
- X.PP
- X.I Mdb
- Xprovides a means of debugging
- X.MX
- Xprograms.
- XIt supports symbolic debugging.
- XThe argument,
- X.I executable ,
- Xis a
- X.MX
- Xexecutable file.
- XIf no file is specified the default is \fIa.out\fR.
- XA description of the commands is given in Chap. 9.
- X
- X
- X
- X.SP 1
- /
- echo x - megartc
- sed '/^X/s///' > megartc << '/'
- X.CD "megartc \(en set date from real time clock [Mega ST]"
- X.SX "megartc [\(end]"
- X.FL "\(end" "output some debugging information"
- X.EY "megartc" "Set the date from the Mega ST real time clock"
- X.PP
- X.I Megartc
- Xreads the current date and time from the battery powered real
- Xtime clock in the Mega ST and sets the
- X.MX
- Xtime accordingly.
- X
- X
- X
- /
- echo x - mined
- sed '/^X/s///' > mined << '/'
- X.CD "mined \(en \*(M2 editor"
- X.SX "mined\fR [\fIfile\fR]
- X.FL "\fR(none)"
- X.EX "mined /user/ast/book.3" "Edit an existing file"
- X.EX "mined" "Call editor to create a new file"
- X.EX "ls \(enl | mined" "Use \fImined\fR as a pager to inspect listing"
- X.PP
- X.I Mined
- X(pronounced min-ed) is a simple full-screen editor.
- XWhen editing a file, it holds the file in memory, thus speeding up
- Xediting, but limiting the editor to files of up to about 35K.
- XLarger files must first be cut into pieces by
- X.I split .
- XLines may be arbitrarily long.
- XOutput from a command may be piped into
- X.I mined
- Xso it can be viewed without scrolling off the screen.
- XSee also Chap. 9.
- X
- X
- X
- /
- echo x - minimacros
- sed '/^X/s///' > minimacros << '/'
- X.de CD
- X.ne 2
- X.if t .ta 0.9i 1.15i 2.75i 3.25i 3.75i
- X.if n .ta 11m 15m 40m
- X.nr x 0 0
- X.nr y 0 0
- X.nr z 0 0
- X.if n #\\$1
- X.if n .br
- X\\fBCommand:\& \\$1\\fR
- X.br
- X..
- X.de SX
- X.if \\nx<=0 \\fBSyntax:\& \\$1
- X.if \\nx>0 \& \\fB\\$1
- X.nr x 1 1
- X.br
- X..
- X.de FL
- X.if \\ny<=0 \\fBFlags:\& \\fB\\$1 \\fR\\$2
- X.if \\ny>0 \& \\fB\\$1 \\fR\\$2
- X.nr y 1 1
- X.br
- X..
- X.de EX
- X.br
- X.nf
- X.if \\nz<=0 \\fB\&Examples: \\fR\\$1 \\fR# \\$2
- X.if \\nz>0 \& \\fR\\$1 \\fR# \\$2
- X.nr z 1 1
- X.br
- X..
- X.de EY
- X.br
- X.nf
- X.if \\nz<=0 \\fB\&Example: \\fR\\$1 \\fR# \\$2
- X.if \\nz>0 \& \\fR\\$1 \\fR# \\$2
- X.nr z 1 1
- X.br
- X..
- X
- /
- echo x - minix
- sed '/^X/s///' > minix << '/'
- X.CD "minix \(en \*(M2 bootstrap [AMIGA]"
- X.SX "minix \fR [\fB\(ene \fRadr] [\fB\(enf \fRadr] [\fB\(enk \fRfile] [\fB\(enl \fRadr] [\fB\(enm \fRadr] [\fB\(enn \fRadr] [\fB\(enq \fRfreq]"
- X.br
- X.ti 1.45i
- X[\fB\(enr \fRrate] [\fB\(ens \fRadr] [\fB\(ent \fRfreq] [\fB\(en?]"
- X.FL "\(ene" "Kernel execute address (default: kernel destination address)"
- X.FL "\(enf" "Font data e.g. $fc1234 (default: romfont)"
- X.FL "\(enk" "Kernel image data file (default: \fIminix.img\fR)"
- X.FL "\(enl" "Kernel image already loaded, at given address"
- X.FL "\(enm" "Address of 256K memory chunk you want to include in list"
- X.FL "\(enn" "Address of 256K memory chunk you want to exclude from list"
- X.FL "\(enq" "Set keyboard repeat speed, default=15 Hz"
- X.FL "\(enr" "Set diskette seek rate (default: 4000 \(*msec)"
- X.FL "\(ens" "Kernel destination address (default: $000200)"
- X.FL "\(ent" "Set clock freq (default: PAL=7093790 Hz, NTSC=7159090 Hz)"
- X.FL "\(en?" "Display this message"
- X.EX "minix" "Boot \*(M2 from the default \fIminix.img\fRfile"
- X.EX "minix \(enm $300000" "Add a 256K RAM block at $300000 and boot"
- X.EX "minix \(ent 7093700" "Set a slightly lower clock rate and then boot"
- X.PP
- XThe casual user will (should) probably never use most of these options,
- Xbut they might be helpful for development purposes.
- XIf you do not know what you are doing, do not use these options; wait until you
- Xhave become an expert.
- X
- X
- X
- /
- echo x - mkdir
- sed '/^X/s///' > mkdir << '/'
- X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
- X.CD "mkdir \(en make a directory"
- X.SX "mkdir [\fB\(enp\fR] [\fB\(enm \fImode\fR] \fIdirectory ..."
- X.FL "\(enm" "Create directory with mode"
- X.FL "\(enp" "Create missing intermediate directories"
- X.EX "mkdir dir" "Create \fIdir\fP in the current directory"
- X.EX "mkdir \(enp /user/ast/dir" "Create the \fI/user/ast\fP and \fI/user/ast/dir\fP"
- X.PP
- XThe specified directory or directories are created and initialized. If any
- Xintermediate directory is missing and \fB(enp\fR is specified, the missing
- Xcomponent will be created and no error displayed if directory already
- Xexists. If the \fB\(enm\fR flag is used, this will be equivalent to a chmod
- Xon the directory after its creation.
- X
- X
- X
- /
- echo x - mkfifo
- sed '/^X/s///' > mkfifo << '/'
- X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
- X.CD "mkfifo \(en make a named pipe"
- X.SX "mkfifo [\fB\(enm \fImode\fR] \fIfifo ..."
- X.FL "\(enm" "Create fifo with specified mode"
- X.EX "mkfifo pipe" "Create \fIpipe\fP in the current directory"
- X.EX "mkfifo -m a+w systatus" "Create the \fIsystatus\fP writable by all"
- X.PP
- XThe specified fifo special files are created.
- XIf the \fB\(enm\fR flag is used, this will be equivalent to a chmod
- Xon the fifo special file after its creation.
- X
- X
- X
- /
- echo x - mkfs
- sed '/^X/s///' > mkfs << '/'
- X.CD "mkfs \(en make a file system"
- X.SX "mkfs \fR[\fB\(enLdot\fR] \fIspecial \fIprototype"
- X.FL "\(enL" "Make a listing on standard output"
- X.FL "\(end" "Use mod time of \fImkfs\fR binary for all files"
- X.FL "\(eno" "Use a drive other than 0 or 1 (safety precaution)"
- X.FL "\(ent" "Do not test if file system fits on the medium"
- X.FL "\(en1" "Make a version 1 file system (for backward compatibility)"
- X.EX "mkfs /dev/fd1 proto" "Make a file system on \fI/dev/fd1\fR"
- X.EX "mkfs /dev/fd1 360" "Make empty 360 block file system"
- X.PP
- X.I Mkfs
- Xbuilds a file system and copies specified files to it.
- XThe prototype file tells which directories and files to copy to it.
- XIf the prototype file cannot be opened, and its name is just a string of
- Xdigits, an empty file system will be made with the specified number of
- Xblocks.
- XA sample prototype file follows.
- XThe text following the \fI#\fR sign in the example below is comment.
- XIn real prototype files, comments are not allowed.
- X.SP 0.5
- X.HS
- X.nf
- X.ta 0.20i 0.70i 1.10i 3i 3.5i 4i
- X boot # boot block file (ignored)
- X 360 63 # blocks and i-nodes
- X d--755 1 1 # root directory
- X bin d--755 \|2 1 # bin dir: mode (755), uid (2), gid (1)
- X sh \|---755 2 1 /user/bin/shell # shell has mode \fIrwxr-xr-x\fP
- X mv -u-755 2 1 /user/bin/mv # u = SETUID bit
- X login -ug755 2 1 /user/bin/login # SETUID and SETGID
- X $ # end of \fI/bin\fP
- X dev d--755 2 1 # special files: tty (char), fd0 (block)
- X tty c--777 2 1 4 0 # uid=2, gid=1, major=4, minor=0
- X fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks
- X $ # end of \fI/dev\fP
- X user d--755 12 1 # user dir: mode (755), uid (12), gid (1)
- X ast d--755 12 1 # \fI/user/ast\fP
- X $ # \fI/user/ast\fP is empty
- X $ # end of \fI/user\fP
- X $ # end of root directory
- X.HS
- X.SP 0.5
- X.fi
- XThe first entry on each line (except the first 3 and the $ lines, which
- Xterminate directories) is the name the file or directory will get on the
- Xnew file system.
- XNext comes its mode, with the first character being
- X\fB\(endbc\fR for regular files, directories, block special files and character
- Xspecial files, respectively.
- XThe next two characters are used to specify the SETUID and SETGID bits, as
- Xshown above.
- XThe last three characters of the mode are the
- X.I rwx
- Xprotection bits.
- X.PP
- XFollowing the mode are the uid and gid.
- XFor special files, the major and minor devices are needed.
- XThe size in blocks must also be specified for block special files (the
- X.MX
- Xblock size is 1K; this can only be changed by changing
- X.I BLOCK_SIZE
- Xand then recompiling the operating system).
- X
- X
- X
- /
- echo x - mknod
- sed '/^X/s///' > mknod << '/'
- X.CD "mknod \(en create a special file"
- X.SX "mknod \fIfile\fR [\fBb\fR] [\fBc\fR] \fImajor \fIminor \fR[\fIsize\fR]"
- X.FL "\fR(none)"
- X.EX "mknod /dev/plotter c 7 0" "Create special file for a plotter"
- X.EX "mknod /dev/fd3 b 2 3 360" "Create a 360K device for diskette drive 3"
- X.PP
- X.I Mknod
- Xcreates a special file named
- X.I file ,
- Xwith the indicated major and minor device numbers.
- XThe second argument specifies a block or character file.
- XBlock devices have a size, which must be specified in blocks.
- XCharacter devices do not have a size so the fifth argument is omitted.
- X
- X
- X
- /
- echo x - mkproto
- sed '/^X/s///' > mkproto << '/'
- X.CD "mkproto \(en create a \s-2MINIX\s0 prototype file"
- X.SX "mkproto \fR[\fB\(enb \fIn\fR] [\fB\(end \fIstr\fR] [\fB\(eng \fIn\fR] [\fB\(eni \fIn\fR] [\fB\(enp \fInnn\fR] [\fB\(ens\fR] [\fB\(ent \fIroot\fR] [\fB\(enu \fIn\fR]"
- X.FL "\(enb" "Number of blocks in the prototype is \fIn\fR"
- X.FL "\(end" "Indent the prototype file using \fIstr\fR instead of tab"
- X.FL "\(eng" "Use \fIn\fR as the gid for all files and directories"
- X.FL "\(eni" "Number of i-nodes in the prototype is \fIn\fR"
- X.FL "\(enp" "Use \fInnn\fR (3 octal digits) as the protection mode"
- X.FL "\(ens" "Use the same uid, gid and mode as the source files have"
- X.FL "\(ent" "Use the string \fIroot\fR as the path prefix for every file"
- X.FL "\(enu" "Use \fIn\fR as the uid for all files and directories"
- X.EX "mkproto \(enb360" "Make a 360K prototype of this directory"
- X.EX "mkproto \(enu2 \(eng1 \(enp644" "Give all files uid 2, gid 1 and mode 644"
- X.PP
- X\fIMkproto\fR creates an \fImkfs\fR prototype file for the specified
- Xsource-directory.
- XThe prototype file is either written to \fIstdout\fR or, if specified,
- Xthe proto-file.
- X
- X
- X
- /
- echo x - modem
- sed '/^X/s///' > modem << '/'
- X.CD "modem \(en switch the modem and getty state"
- X.SX "modem \fR[\fB\(eno\fR] [\fB\(eni \fInum\fR] \fBtty\fIn\fR"
- X.FL "\(eno" "Turn getty off and set modem to dialout"
- X.FL "\(eni" "Set line to dialin"
- X.EX "modem \(eno tty1" "Set tty1 to dialout"
- X.EX "modem \(eni2 tty1" "Set tty1 to dialin (2 rings)"
- X.PP
- XThe \fIgetty\fR program allows a terminal port to be used for both dialin and
- Xdialout.
- XThis little program switches the getty state, and also sends
- Xsome commands to the modem attached to the specified line.
- XIf the \fB\(eno\fR flag is presnt, \fImodem\fR will put the
- Xgetty process (if any) connected to the specified line into
- XSUSPEND state, which means that it
- Xwill not pay attention to that line until it is reset to RESTART state.
- XAlso, \fImodem\fR will send some (Hayes)
- Xcommands to the attached modem to disable the auto-nanswer mode.
- XThe \fB\(eni\fR flag specifies the number of times the telephone has to
- Xring before the modem may answer the call (to give the operator a chance).
- X
- X
- X
- X.SP 1
- /
- echo x - mon_man
- sed '/^X/s///' > mon_man << '/'
- X 5 K 4034: 10 Dec 92 Kees J. Bot Little monitor document
- X(Message # 5: 4034 bytes, KEEP)
- XReceived: from spanker.cs.vu.nl by top.cs.vu.nl id aa00984; 10 Dec 92 9:49 MET
- XReceived: from hornet.cs.vu.nl by spanker.cs.vu.nl id aa00324;
- X 10 Dec 92 9:49 MET
- XDate: Thu, 10 Dec 92 9:49:24 MET
- XFrom: "Kees J. Bot" <kjb@cs.vu.nl>
- XTo: ast@cs.vu.nl
- XSubject: Little monitor document
- XMessage-ID: <9212100949.aa16951@hornet.cs.vu.nl>
- X
- XI've written a small document on the monitor as you requested. Below is
- Xa shar file with the nroff source. The command
- X
- X nroff -ms mon.doc.ms | colcrt - > mon.doc
- X
- Xwill turn it into a flat file. Only the page breaks are left to be
- Xremoved.
- X
- X(I should be less vocal on the net, now someone sent his Minix questions
- Xto me, but the praise still goes to you: "Tell Andy he did a superb job
- Xputting this OS together." Just passing it on. :-)
- X--
- X Kees.
- X_._. .._ _ ._ ._.. ___ _. __. _ .... . _.. ___ _ _ . _.. ._.. .. _. .
- X: This is a shar archive. Extract with sh, not csh.
- X: This archive ends with exit, so do not worry about trailing junk.
- X: --------------------------- cut here --------------------------
- XPATH=/bin:/usr/bin:/usr/ucb
- Xecho Extracting 'mon.doc.ms'
- Xsed 's/^X//' > 'mon.doc.ms' << '+ END-OF-FILE ''mon.doc.ms'
- XX.SH
- XXDoing more with the Minix Boot Monitor.
- XX.PP
- XXThis text describes the menu interface of the Minix Boot Monitor, and
- XXthe commands that may be used to customize it.
- XX.LP
- XXFirst of all, the monitor mode as distributed normally hides some of the
- XXfunctionality, but shows you an explanation of the environment
- XXvariables instead. If you add -DEXTENDED_LIST to CFLAGS in the Makefile
- XXand recompile, then you will no longer see the long explanation (you
- XXshould know it by now), but you will see all the commands the monitor
- XXknows about.
- XX.SH
- XXThe commands.
- XX.PP
- XXThe boot command has two functions, one is to load and start Minix, the
- XXother is to boot a different operating system. If the first partition
- XXon your hard disk contains MS-DOS, then
- XX.DS
- XX.B
- XXboot hd1
- XX.R
- XX.DE
- XXwill boot MS-DOS. (Not all operating systems like to be called this
- XXway, some insist on being on the active partition.)
- XX.LP
- XXThe delay, ls, and other simple commands are not too difficult to
- XXunderstand, just try them out. The trap command may be used to execute
- XXa function after a delay. You can show a menu first and boot Minix
- XXafter 5 seconds of inactivity like this:
- XX.DS
- XX.B
- XXtrap 5000 boot; menu
- XX.R
- XX.DE
- XX(This must be typed on one line, traps are cancelled when the prompt is
- XXprinted.)
- XX.SH
- XXFunctions.
- XX.PP
- XXFunctions are used to bundle commands, or to build menu items. The best
- XXexample of a simple function is 'main', the function executed by the
- XXmonitor on startup. Main is by default defined as:
- XX.DS
- XX.B
- XXmain() { menu }
- XX.R
- XX.DE
- XXSo that's why you see a menu at the start. The example with 'trap'
- XXabove could be executed by main if you type:
- XX.DS
- XX.B
- XXmain() { trap 5000 boot; menu }
- XXsave
- XX.R
- XX.DE
- XXThe save command will save the changed environment of the monitor to the
- XXsecond half of the boot block, the "boot parameters sector".
- XX.LP
- XXFunctions may have one or two arguments, the first is a key to be
- XXpressed from the menu to execute the function, the optional second
- XXargument is the text that is to be displayed on the menu. The single
- XXargument functions should only be produced by construct, like this
- XXone:
- XX.DS
- XX.B
- XXAT(a) {label=AT;image=42:626;echo AT kernel selected;menu}
- XX.R
- XX.DE
- XXIt invites you to choose one of many kernels on a special boot floppy.
- XX.LP
- XXThe two argument functions are used to customize the menu, once you
- XXdefine one the default option disappears, so your first function will
- XXprobably be one to start Minix. Example:
- XX.DS
- XX.B
- XXminix(=,Start Minix) { boot }
- XXdos(d,Boot MS-DOS) { boot hd1 }
- XXsave
- XXmenu
- XX.R
- XX.DE
- XXNow you can type '=' or 'd' to choose between Minix and DOS.
- X+ END-OF-FILE mon.doc.ms
- Xchmod 'u=rw,g=r,o=r' 'mon.doc.ms'
- Xset `wc -c 'mon.doc.ms'`
- Xcount=$1
- Xcase $count in
- X2542) :;;
- X*) echo 'Bad character count in ''mon.doc.ms' >&2
- X echo 'Count should be 2542' >&2
- Xesac
- Xexit 0
- /
- echo x - more
- sed '/^X/s///' > more << '/'
- X.CD "more \(en pager"
- X.SX "more\fR [\fB\(endf\&lpsu\fR]\fR [\fB\(en\fIn\fR] [\fB+\fIn\fR] [\fB+\fR/\fIpattern\fR] [\fIfile\fR] ..."
- X.FL "\(end" "Display prompt message at each pause"
- X.FL "\(enf" "Do not fold lines"
- X.FL "\(enl" "Do not treat CTRL-L as form feed"
- X.FL "\(enp" "Page mode. Do not scroll"
- X.FL "\(ens" "Suppress multiple blank lines"
- X.FL "\(enu" "Use escape sequences for underlining"
- X.EX "more file" "Display file on the screen"
- X.EX "more \(enp file1 file2" "Display two files in page mode"
- X.EX "more \(en10 file" "Use a 10 line window"
- X.EX "more +/begin file" "Hunt for the string \fIbegin\fR"
- X.PP
- X\fIMore\fR is a pager that allows one to examine files.
- XWhen \fImore\fR starts up, it displays a screenful of information from the
- Xfirst file in its list, and then pauses for one of the following commands.
- XIn this description, # represents an integer telling how many of something.
- X.HS
- X.nf
- X.ta 0.5i 1.5i
- X <space> \(en Display next page
- X <return> \(en Display next line
- X CTRL-B \(en Go backward half a screenful
- X CTRL-D \(en Go forward half a screenful
- X CTRL-L \(en Redisplay the screen
- X #<space> \(en Go forward # lines
- X = \(en Print current line number
- X . \(en Repeat previous command
- X ' \(en (single quote) Go back to start of last search
- X ! \(en Escape to a shell
- X #/<expr> \(en Go to #-th occurrence of <expr>
- X :f \(en Display current file name and line number
- X #:n \(en Skip forward # files
- X #:p \(en Skip backward # files
- X b \(en Go backward half a screenful
- X d \(en Go forward half a screenful
- X #f \(en Skip # screenfuls
- X h \(en Display \fI/usr/lib/more.help\fR
- X #n \(en Go to #-th occurence of last <expr>
- X q \(en Quit \fImore\fR
- X Q \(en Quit \fImore\fR
- X #s \(en Skip # lines
- X v \(en Try to execute \fI/usr/bin/vi\fR
- X #z \(en Go forward # lines and set screen size to #
- X.fi
- X.HS
- XFor the benefit of users who always want to use certain flags when calling
- X\fImore\fR, the shell variable MORE can be set,
- Xfor example, to MORE="\(ENp".
- X
- X
- X
- /
- echo x - mount
- sed '/^X/s///' > mount << '/'
- X.CD "mount \(en mount a file system"
- X.SX "/etc/mount \fIspecial \fIfile\fR [\fB\(enr\fR]"
- X.FL "\(enr" "File system is mounted read-only"
- X.EY "/etc/mount /dev/fd1 /user" "Mount diskette 1 on \fI/user\fP"
- X.PP
- XThe file system contained on the special file is mounted on \fIfile\fP.
- XIn the example above, the root directory of the file system in drive 1
- Xcan be accessed as
- X.DI /user
- Xafter the mount.
- XWhen the file system is no longer needed, it must be unmounted before being
- Xremoved from the drive.
- X
- X
- X
- /
- echo x - mref
- sed '/^X/s///' > mref << '/'
- X.CD "mref \(en make listing and cross reference map of \s-2MINIX\s0"
- X.SX "mref\fR [\fB\(endlmstx\fR] [\fB\(enp \fIn\fR] [\fB\(en\fIn\fR] \fIfile ..."
- X.FL "\(end" "Do not produce definition file (global symbol table)"
- X.FL "\(enl" "Do not produce listing"
- X.FL "\(enm" "Multiple references on one line are cited only once"
- X.FL "\(enp" "Set initial page number to \fIn\fR"
- X.FL "\(ens" "Suppress line numbering between procedures"
- X.FL "\(ent" "Generate output for \fItroff\fR"
- X.FL "\(enx" "Do not produce the cross reference map"
- X.FL "\(en\fIn" "Number of lines to print per page, default = 50"
- X.EX "mref *.[\fIhc\fR]" "List and cross reference files \fI.h\fR and \fI.c\fR"
- X.EX "mref \(en60 \(ent *.c" "Produce \fItroff\fR input at 60 lines/page"
- X.EX "mref \(endx \(enp 100 *.c" "Listing only, first page is numbered 100"
- X.PP
- XIn default mode,
- X.I mref
- Xproduces three output files: a numbered listing of the input files
- X(on standard output), a global symbol table (on \fIsymbol.out\fR),
- Xand a cross reference map to the global symbols (on \fIxref.out\fR).
- XA global symbol in this context is one present in a #define, PUBLIC,
- XPRIVATE, or SYMBOL statement (the latter being introduced to allow users
- Xto explicitly declare certain symbols as global).
- XAny of the three outputs can be suppressed, or alternatively, be made
- Xsuitable for input to \fItroff\fR for typesetting.
- X
- X
- X
- /
- echo x - mv
- sed '/^X/s///' > mv << '/'
- X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
- X.CD "mv \(en move or rename a file"
- X.SX "mv [\fB\(enf\&i\fR] \fIfile1 file2"
- X.SX "mv [\fB\(enf\&i\fR] \fIfile\fR ... \fIdirectory"
- X.FL "\(enf" "Do not prompt before removing existing files"
- X.FL "\(eni" "Prompt before removing existing files"
- X.EX "mv oldname newname" "Move \fIoldname\fP to \fInewname\fP"
- X.EX "mv file1 file2 /user/ast" "Move two files to \fI/user/ast\fP"
- X.PP
- X.I Mv
- Xmoves one or more files from one place in the file system to another.
- XIf the old path and new path are on the same device, it is done by renaming
- Xotherwise by copying. If you're not superuser, the copy will destroy the
- Xfile's owner, group and setuid/setgid bits.
- X.I mv
- Xwill prompt before removing non-writable files if \fBstdin\fR is a terminal
- Xor the \fB\(eni\fR flag was specified.
- X
- X
- X
- /
- echo x - ncheck
- sed '/^X/s///' > ncheck << '/'
- X.CD "ncheck \(en i-node to name converter"
- X.SX "ncheck\fR [\fB\(eni\fI numbers\fR] [\fB\(ena\fR] [\fB\(ens\fR] \fIfile_system\fR"
- X.FL "\(ena" "List all files, even . and .."
- X.FL "\(eni" "Followed by a list of i-nodes"
- X.FL "\(ens" "List only special and setuid files"
- X.EX "ncheck \(en /dev/fd0" "List everything on \fI/dev/fd0\fR"
- X.EX "ncheck \(eni 10,15 /dev/fd0" "List i-nodes 10 and 15 on \fI/dev/fd0\fR"
- X.PP
- X\fISometimes one knows about an i-node number and wants to find the file
- Xname that goes with it. This program makes that mapping.
- XThe default is to list everything on the device, but the \fB\(eni\fR
- Xflag restricts the list to specified i-nodes and the \fB\(ens\fR flag
- Xrestricts it to special files and setuid files (to look for possible
- Xsecurity violations).
- /
- echo x - nm
- sed '/^X/s///' > nm << '/'
- X.CD "nm \(en print name list"
- X.SX "nm\fR [\fB\(endgnopru\fR]\fR [\fIfile\fR] ..."
- X.FL "\(end" "Print the offsets in decimal instead of in hex"
- X.FL "\(eng" "Print only external symbols"
- X.FL "\(enn" "Sort numerically rather than alphabetically"
- X.FL "\(eno" "Prepend file name to each line rather than only once"
- X.FL "\(enp" "Do not sort, print in symbol-table order"
- X.FL "\(enr" "Sort in reverse order"
- X.FL "\(enu" "Print only undefined symbols"
- X.EX "nm \(enn a.out" "Print all symbols in numerical order"
- X.EX "nm \(endg a.out" "Print globals alphabetically in decimal"
- X.PP
- X\fINm\fR prints the symbol table of executable files when it is available.
- XIf no file is given, the symbols in \fIa.out\fR are used.
- XThe format of the table
- Xis somewhat compatible with the one produced by \fIasld\fR when used with
- Xthe \fB\(ens\fR option. The symbol table can be added with \fIast\fR.
- XAssembly language files do not have symbol tables.
- X
- X
- X
- /
- echo x - nroff
- sed '/^X/s///' > nroff << '/'
- X.CD "nroff \(en text formatter"
- X.SX "nroff\fR [\fB\(enbv\fR]\fR [\fB\(enm\fImacros\fR] [\fB\(enp\fIn\fR] [\fB\(en\fRn\fR] [\fB+\fRn\fR] [\fIfile\fR] ..."
- X.FL "\(enb" "Output device can backspace"
- X.FL "\(enm" "Use \fI/usr/lib/tmac/tmac.\fR macros"
- X.FL "\(env" "Print \fInro\fR version number"
- X.FL "\(mi\fIn\fR" "Last page to print"
- X.FL "+\fIn\fR" "First page to print"
- X.EX "nroff infile >outfile" "Format \fIinfile\fR"
- X.EX "nroff +3 \(en5 infile >outfile" "Only output pages 3-5"
- X.PP
- X\fINroff\fR is a text formatter like \fIroff\fR, but more flexible.
- XUnlike \fIroff\fR, it accepts parametrized macros, for example.
- XThe commands are given in Chap. 9.
- X
- X
- X
- /
- echo x - od
- sed '/^X/s///' > od << '/'
- X.CD "od \(en octal dump"
- X.SX "od\fR [\fB\(enbcdhox\fR]\fR [\fIfile\fR] [ [\fB+\fR] \fIoffset\fR [\fB.\fR][\fBb\fR]\fR ]"
- X.FL "\(enb" "Dump bytes in octal"
- X.FL "\(enc" "Dump bytes as ASCII characters"
- X.FL "\(end" "Dump words in decimal"
- X.FL "\(enh" "Print addresses in hex (default is octal)"
- X.FL "\(eno" "Dump words in octal (default)"
- X.FL "\(env" "Verbose (list duplicate lines)"
- X.FL "\(enx" "Dump words in hex"
- X.EX "od \(enox file" "Dump \fIfile\fP in octal and hex"
- X.EX "od \(end file +1000" "Dump \fIfile\fP starting at byte 01000"
- X.EX "od \(enc file +10.b" "Dump \fIfile\fP starting at block 10"
- X.PP
- X.I Od
- Xdumps a file in one or more formats.
- XIf \fIfile\fP is missing, \fIstdin\fR is dumped.
- XThe \fIoffset\fP argument tells
- X.I od
- Xto skip a certain number of bytes or blocks before starting.
- XThe offset is in octal bytes, unless it is followed by a
- X\*(OQ.\*(CQ for decimal or \fBb\fP for blocks or both.
- X
- X
- X
- /
- echo x - passwd
- sed '/^X/s///' > passwd << '/'
- X.CD "passwd \(en change a login password"
- X.SX "passwd\fR [\fIname\fR]"
- X.FL "\fR(none)"
- X.EX "passwd" "Change current user's password"
- X.EX "passwd ast" "Change ast's password (super\(enuser only)"
- X.PP
- X.I Passwd
- Xis used to change your password.
- XIt prompts for the old and new passwords.
- XIt asks for the new password twice, to reduce the effect of a typing error.
- XDo not forget to copy the modified password file back to the root file system,
- Xor the changes will be lost when the system is rebooted.
- X
- X
- X
- /
- echo x - paste
- sed '/^X/s///' > paste << '/'
- X.CD "paste \(en paste multiple files together"
- X.SX "paste\fR [\fB\(ens\fR]\fR [\fB\(end\fI list\fR] \fIfile..."
- X.FL "\(end" "Set delimiter used to separate columns to \fIlist\fR.
- X.FL "\(ens" "Print files sequentially, file \fIk\fR on line \fIk\fR.
- X.EX "paste file1 file2" "Print \fIfile1\fR in col 1, \fIfile2\fR in col 2"
- X.EX "paste \(ens f1 f2" "Print \fIf1\fR on line 1 and \fIf2\fR on line 2"
- X.EX "paste -d : file1 file2" "Print the lines separated by a colon"
- X.PP
- X\fIPaste\fR concatenates corresponding lines of the given input files
- Xand writes them to standard output. The lines of the different files
- Xare separated by the delimiters given with the option \(ens\fR. If
- Xno list is given, a tab is substituted for every linefeed, except the last one.
- XIf end-of-file is hit on an input file, subsequent lines are empty.
- XSuppose a set of \fIk\fR files each has one word per line.
- XThen the \fIpaste\fR output will have \fIk\fR columns,
- Xwith the contents of file \fIj\fR in column \fIj\fR.
- XIf the \fB\(ens\fR flag is given, then the first
- Xfile is on line 1, the second file on line 2, etc.
- XIn effect, \fB\(ens\fR turns the output sideways.
- X.PP
- XIf a list of delimiters is given, they are used in turn. The C escape
- Xsequences \\n, \\t, \\\\, and \\0 are used for linefeed, tab, backslash, and
- Xthe null string, respectively.
- /
- echo x - patch
- sed '/^X/s///' > patch << '/'
- X.CD "patch \(en patches up a file from the original and a diff"
- X.SX "patch\fR [\fB\(enNRbcdef\&lnop\fR]\fR [\fB\(enF\fIn\fR] [\fB\(enD \fIlabel\fR] [\fIfile \fR[\fIdifflist\fR]]"
- X.FL "\(enD" "Mark changes with #ifdef...#endif next arg gives label"
- X.FL "\(enF" "Sets the maximum fuzz factor to \fIn\fR"
- X.FL "\(enN" "Ignore patches that are reversed or already applied"
- X.FL "\(enR" "Reverse the patches"
- X.FL "\(enb" "Next argument is backup extension, instead of using a tilde (\(ap)"
- X.FL "\(enc" "Interpret the patch file as a context diff"
- X.FL "\(end" "Cd to the next arg (assumed a dir) before doing anything"
- X.FL "\(ene" "Interpret the patch file as an ed script"
- X.FL "\(enf" "Forces \fIpatch\fR to do its work without asking any questions"
- X.FL "\(enl" "Do matching loosely (e.g., all white space is equivalent)"
- X.FL "\(enn" "Interpret the patch file as a normal diff"
- X.FL "\(eno" "Next argument is the output file name"
- X.FL "\(enp" "Sets the pathname strip count"
- X.EX "patch file difflist" "Fix up \fIfile\fR"
- X.EX "patch <difflist" "Patch multiple files"
- X.PP
- X\fIPatch\fR takes an original file and a diff listing and recreates the
- Xnew file. It is functionally similar to
- X\fIfix\fR, but much more powerful. Not only
- Xcan it handle normal diffs, but also context diffs produced by \fIcdiff\fR. In
- Xaddition, it works even when the file being patched has other changes to it.
- XIt deduces the type of \fIdifflist\fR itself (unless
- Xgiven \fB\(enc\fR, \fB\(ene\fR, or \fB\(enn\fR).
- XThe normal usage is given in the example above. In this case \fIpatch\fR will
- Xmodify \fIfile\fR to incorporate all the patches.
- XThe original file will be saved to a file ending in a tilde (\(ap).
- X.PP
- XIf no input file is given, \fIpatch\fR reads \fIstdin\fR which may contain
- Xthe concatenation of multiple diff listings.
- XIn this way, all the files in a directory may be updated at once.
- XSee Chap. 9 for more information.
- X
- X
- X
- /
- echo x - pathchk
- sed '/^X/s///' > pathchk << '/'
- X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
- X.CD "pathchk \(en check pathname"
- X.SX "pathchk [\fB\(enp\fR] \fIpath\fR ..."
- X.FL "\(enp" "Check against POSIX rules"
- X.EX "pathchk /usr/src/file.c" "Check the accessibility of \fIfile.c\fP"
- X.EX "pathchk \(enp file" "Check posix compliance of \fIfile\fR"
- X.PP
- X.I Pathchk
- Xverifies path names and display error if paths are too long, contain names
- Xthat are too long, go thru a non-searchable directory or contain an
- Xinvalid character in names. If the \fB\(enp\fR flag is specified, the POSIX
- Xrules apply instead of the rules of the current file system.
- X
- X
- X
- X
- /
- echo x - pr
- sed '/^X/s///' > pr << '/'
- X.CD "pr \(en print a file"
- X.SX "pr\fR [\fB\(enMfnt\fR]\fR [\fB\(enh \fIn\fR] [\fB\(enl \fIn\fR] [\fB\(enw \fIn\fR] [\fB\(en\fRcolumns\fR] [\fB+\fIpage\fR] [\fIfile\fR] ..."
- X.FL "\(enM" "Use MINIX style line number"
- X.FL "\(enf" "Do not fold long lines"
- X.FL "\(enh" "Take next argument as page header"
- X.FL "\(enl" "Sets page length in lines"
- X.FL "\(enn" "Number the output lines"
- X.FL "\(ent" "Do not print page header or trailer"
- X.FL "\(enw" "Sets line length in characters"
- X.EX "pr \(enw85 \(enl60 file" "Use 85 character line, 60 line page"
- X.EX "pr \(en3 file" "List \fIfile\fP three columns to a page"
- X.EX "pr +4 file" "Start printing with page 4"
- X.PP
- X.I Pr
- Xformats one or more files for printing.
- XIf no files are specified, \fIstdin\fR is printed.
- XOptions are provided for setting the width and height of the page, the
- Xnumber of columns to use (default 1), and the page to start with, among others.
- X
- X
- X
- /
- echo x - prep
- sed '/^X/s///' > prep << '/'
- X.CD "prep \(en prepare a text file for statistical analysis"
- X.SX "prep\fR [\fIfile\fR]"
- X.FL "\fR(none)"
- X.EY "prep infile >outfile" "Prepare \fIinfile\fR"
- X.PP
- X\fIPrep\fR strips off most of the troff commands from a text file and then
- Xoutputs all the words, one word per line, in the order they occur in the file.
- XThis file can then be sorted and compared to a dictionary (as a spelling
- Xchecker), or used for statistical analyses.
- X
- X
- X
- /
- echo x - pretty
- sed '/^X/s///' > pretty << '/'
- X.CD "pretty \(en \s-2MINIX\s0 pretty printer"
- X.SX "pretty \fIfile ..."
- X.FL "\fR(none)"
- X.EY "pretty file1 file2" "Convert two files to \s-2MINIX\s0 layout"
- X.PP
- X\fIPretty\fR converts one or more C source files to
- X.MX
- Xformat by changing
- Xtheir layout. Running this program does not affect the resulting binary
- Xprograms. Actually, \fIpretty\fR is a postprocessor for \fIindent\fR, which
- Xmust be installed in \fI/bin\fR or \fI/usr/bin\fR. Although the output is
- Xnot bad, it is not entirely consistent with the book or even with itself.
- X
- X
- X
- /
- echo x - printenv
- sed '/^X/s///' > printenv << '/'
- X.CD "printenv \(en print out the current environment"
- X.SX "printenv"
- X.FL "\fR(none)"
- X.EY "printenv" "Print the environment"
- X.PP
- X\fIPrintenv\fR prints out the current environment strings, one per line.
- X
- X
- X
- /
- echo x - printroot
- sed '/^X/s///' > printroot << '/'
- X.CD "printroot \(en print the name of the root device on standard output"
- X.SX "printroot"
- X.FL "\fR(none)"
- X.EY "printroot" "Print the name of the root device"
- X.PP
- X.I Printroot
- Xis useful for initializing the \fI/etc/mtab\fR entry when the system is
- Xbooted.
- XIt figures out what the root device is by searching \fI/dev\fR until it
- Xfinds a block special file with the right major/minor device numbers.
- X
- X
- X
- X.SP 1
- /
- echo x - ps
- sed '/^X/s///' > ps << '/'
- X.CD "ps \(en process status"
- X.SX "ps [\(fB\(en\fR] [\(fBalxU\fR] [\(fBkernel mm fs\fR]"
- X.FL "\(ena" "Print all processes with controlling terminals"
- X.FL "\(enl" "Give long listing"
- X.FL "\(enx" "Include processes without a terminal"
- X.FL "\(enU" "Update (optional) name database"
- X.EX "ps \(enaxl" "Print all processes and tasks in long format"
- X.EX "ps \(enU /kernel /fs /mm" "Update database with given namelists"
- X.PP
- X\fIPs\fR prints the status of active processes. Normally only the caller's own
- Xprocesses are listed in short format (the PID, TTY, TIME and CMD fields as
- Xexplained below). The long listing contains:
- X.HS
- X.ta 0.5i 1.0i
- X F Kernel flags:
- X 001: free slot
- X 002: no memory map
- X 004: sending;
- X 010: receiving
- X 020: inform on pending signals
- X 040: pending signals
- X 100: being traced.
- X.HS
- X S
- X State:
- X R: runnable
- X W: waiting (on a message)
- X S: sleeping (i.e.,suspended on MM or FS)
- X Z: zombie
- X T: stopped
- X.HS
- X UID, PID, PPID, PGRP
- X The user, process, parent process and process group ID's.
- X.HS
- X ADDR, SZ
- X Decimal address and size of the process in kilobytes.
- X.HS
- X RECV
- X Process/task on which a receiving process is waiting or sleeping.
- X.HS
- X TTY
- X Controlling tty for the process.
- X.HS
- X TIME
- X Process' cumulative (user + system) execution time.
- X.HS
- X CMD Command line arguments of the process.
- X.HS
- X.PP
- XIf extra arguments (the kernel, mm and fs nonstripped executables) are
- Xgiven, these are used to obtain the system addresses from (instead of the
- Xdefault system executables). This applies to the \fB\(enU\fR option also.
- XThis option creates \fI/etc/psdatabase\fR that contains system addresses and
- Xterminal names, after which \fIps\fR is faster and doesn't need the system
- Xexecutables anymore.
- X.PP
- XThe default system executables are \fI/usr/src/{kernel/kernel,mm/mm,fs/fs}\fR.
- XIf the database is updated, an old psdatabase exists, and no paths are given to
- Xps, it uses the paths that were previously stored in the database.
- XA \fIps \(enU\fR" in \fI/etc/rc\fR thus generally ensures an up-to-date
- Xdatabase.
- X.PP
- XThe files \fI/dev/{mem,kmem}\fR are used to read the system tables and command
- Xline arguments from. Terminal names in \fI/dev\fR are used to generate the
- Xmnemonic names in the TTY column, so \fIps\fR is independent of terminal naming
- Xconventions.
- X.PP
- XWarning: \fIps\fR depends heavily on up-to-date system addresses and
- Xparameters.
- XIt prints messages when they appear to be outdated.
- /
- echo x - pwd
- sed '/^X/s///' > pwd << '/'
- X.CD "pwd \(en print working directory"
- X.SX "pwd"
- X.FL "\fR(none)"
- X.EY "pwd~~~~~" "Print the name of the working directory"
- X.PP
- XThe full path name of the current working directory is printed.
- X
- X
- X
- /
- echo x - rcp
- sed '/^X/s///' > rcp << '/'
- X.CD "rcp \(en remote copy [IBM]"
- X.SX "rcp\fR [\fImachine1!\fR]\fIfile1\fR [\fImachine2!\fR]\fIfile2"
- X.FL "\fR(none)"
- X.EX "rcp file mach1!/usr/ast/x" "Local \fIfile\fR to remote machine"
- X.EX "rcp mach2!/usr/ast/x file" "Fetch remote file \fIx\fR"
- X.PP
- X\fIRcp\fR is not a program. It is a shell script that does remote
- Xcopying. It makes use of the programs \fIto\fR and \fIfrom\fR.
- X
- X
- X
- /
- echo x - readall
- sed '/^X/s///' > readall << '/'
- X.CD "readall \(en read a device quickly to check for bad blocks"
- X.SX "readall\fR [\fB\(enbt\fR] \fIfile"
- X.FL "\(enb" "Produce shell script on \fIstdout\fR that calls \fIbadblocks\fR"
- X.FL "\(ent" "Just print device size"
- X.EX "readall /dev/hd0" "Read all of \fI/dev/hd0\fR"
- X.EX "readall -b /dev/hd1 >s" "Generate shell script on \fIs\fR"
- X.PP
- X\fIReadall\fR reads all of the named device in large chunks.
- XIt reports about blocks that it cannot read.
- XUnlike \fIdiskcheck\fR, it does not attempt to write on
- Xthe disk, making it safer to use when one is worried about a sick system.
- XWhen the \fB\(enb\fR flag is given, the output is a shell script that
- Xcalls the \fIbadblocks\fR program to marked all the bad blocks.
- XWhenever installing
- X.MX ,
- Xit is wise to run \fIreadall\fR with the \fB\(enb\fR flag first on all
- Xthe hard disks.
- X
- X
- X
- /
- echo x - readclock
- sed '/^X/s///' > readclock << '/'
- X.CD "readclock \(en read the real time clock [IBM PC/AT and AMIGA]"
- X.SX "readclock"
- X.FL "\fR(none)"
- X.EY "date \`/usr/bin/readclock\` </dev/tty" "Useful in \fI/etc/rc\fR"
- X.PP
- X\fIReadclock\fR reads the AT's real time clock and prints the result in
- Xa form useful to date, namely, MMDDYYhhmmss.
- XIf the clock does not exist (e.g., on a
- XPC), it outputs \*(OQ\(enq\*(CQ to query the user for the time.
- XThe example given above
- Xcan be put in \fI/etc/rc\fR to load the real time when the system is booted.
- X
- X
- X
- /
- echo x - readfs
- sed '/^X/s///' > readfs << '/'
- X.CD "readfs \(en read a \s-2MINIX\s0 file system"
- X.SX "readfs\fR [\fB\(enil\fR] \fIblock_special\fR [\fIdir\fR]"
- X.FL "\(eni" "Give information about the file, but do not extract files"
- X.FL "\(enl" "List the files extracted on standard output"
- X.EY "readfs \(enl /dev/fd0" "List contents of diskette"
- X disk"
- X.PP
- X\fIReadfs\fR reads a diskette containing a
- X.MX
- Xfile system. It can
- Xextract all the files from it, give a listing of them, or both. The files
- Xextracted can be put in a user-specified directory (default: current
- Xdirectory). If subdirectories are needed, they will be created automatically.
- X
- X
- X
- X.SP 1
- /
- echo x - recover
- sed '/^X/s///' > recover << '/'
- X.CD "recover \(en recover files that have been removed."
- X.SX "recover \fIfile ..."
- X.FL (none)
- X.EX "rm x; recover x" "Unremove x"
- X.EX "recover a b c" "Recover three files"
- X.PP
- XMINIX allows files that have been deleted (e.g., with \fIrm\fR) to be
- Xrestored (in \fI/tmp\fR).
- XThe trick is that when a file is unlinked, its i-node number is kept in
- Xthe directory entry.
- XAs long as the directory entry and disk blocks are not reused, the file
- Xcan be recovered.
- XThis program is actually just a little front end for \fIde\fR, which must be
- Xinstalled and executable ast setuid root.
- X
- X
- X
- X.SP 1.6
- /
- echo x - ref
- sed '/^X/s///' > ref << '/'
- X.CD "ref \(en look up a reference in a \fItags\fR file"
- X.SX "ref \fIfunction\fR"
- X.FL "\fR(none)"
- X.EY "ref func" "Find \fIfunc\fR"
- X.PP
- X\fIRef\fR looks up a function name in the \fIrefs\fR file in the current
- Xdirectory.
- XThis file is usually made by \fIctags\fR.
- X
- X
- X
- X.SP 1.6
- /
- echo x - rev
- sed '/^X/s///' > rev << '/'
- X.CD "rev \(en reverse the characters on each line of a file"
- X.SX "rev\fR [\fIfile\fR] ..."
- X.FL "\fR(none)"
- X.EY "rev file" "Reverse each line"
- X.PP
- XEach file is copied to standard output with all the characters of each line
- Xreversed, last one first and first one last.
- X
- X
- X
- X.SP 1.6
- /
- echo x - rm
- sed '/^X/s///' > rm << '/'
- X############ NEXT ENTRY HAS NOT BEEN CHECKED #############
- X.CD "rm \(en remove a file"
- X.SX "rm\fR [\fB\(enRf\&ir\fR] \fIname\fR ..."
- X.FL "\(enf" "Forced remove: no questions asked"
- X.FL "\(eni" "Interactive remove: ask before removing"
- X.FL "\(enR" "Remove directories too"
- X.FL "\(enr" "Same as \fB\(enR\fR"
- X.EX "rm file" "Remove \fIfile\fR"
- X.EX "rm \(eni *.c" "Remove \fI.c\fP files, asking about each"
- X.PP
- X.I Rm
- Xremoves one or more files.
- XIf a file has no write permission,
- X.I rm
- Xasks for permission (type \*(OQy\*(CQ or \*(OQn\*(CQ) unless \fB\(enf\fR
- Xis specified.
- XIf the file is a directory, it will be recursively descended and removed
- Xif and only if the \fB\(enR\fR flag is present.
- X
- X
- X
- /
- echo x - rmaker
- sed '/^X/s///' > rmaker << '/'
- X.CD "rmaker \(en a simple resource compiler [MACINTOSH]"
- X.SX "rmaker \fIinputfile\fR \fIoutputfile\fR"
- X.FL "\fR(none)"
- X.EX "rmaker boot.r vol:dir:f" "Compile the resource described in \fIboot.r\fB
- X.PP
- XRmaker will produce a Macintosh resource file from a resource input
- Xspecification. This is not a complete implementation of a resource
- Xcompiler, and it only understands a relatively small number of resource
- Xformats. The input syntax is similar to that of the well-known rmaker
- Xapplication.
- X.PP
- XThis is a partial list of the resource types it understands:
- X.HS
- X.ta 0.25i 1i
- X.nf
- X '\fBSTR \fR' Strings
- X '\fBBNDL\fR' Bundles
- X '\fBFREF\fR' File refs (for bundles)
- X '\fBHEXA\fR' Hex data
- X '\fBCODE\fR' Code
- X '\fBALRT\fR' Alerts
- X '\fBDITL\fR' Dialog item lists
- X '\fBDLOG\fR' Dialogs
- X '\fBWIND\fR' Window templates
- X '\fBMENU\fR' Menus
- X '\fBICON\fR' ICON
- X '\fBICN#\fR' ICON lists
- X '\fBCURS\fR' Cursors
- X '\fBPAT \fR' Patterns
- X.fi
- X
- X
- X
- /
- echo x - rmdir
- sed '/^X/s///' > rmdir << '/'
- X.CD "rmdir \(en remove a directory"
- X.SX "rmdir \fIdirectory ...
- X.FL "\fR(none)"
- X.EX "rmdir /user/ast/foobar" "Remove directory \fIfoobar\fP"
- X.EX "rmdir /user/ast/f*" "Remove 0 or more directories"
- X.PP
- XThe specified directories are removed.
- XOrdinary files are not removed.
- XThe directories must be empty.
- X
- X
- X
- /
- echo x - roff
- sed '/^X/s///' > roff << '/'
- X.CD "roff \(en text formatter"
- X.SX "roff\fR [\fB\(enhs\fR]\fR [\fB+\fIn\fR] [\fB\(en\fIn\fR] \fIfile\fR ..."
- X.FL "\(enh" "Expand tabs to spaces in output"
- X.FL "\(ens" "Stop before each page; continue on DEL"
- X.FL "+\fIn\fP" "Start printing with page \fIn\fP"
- X.FL "\(en\fIn\fP" "Stop after page \fIn\fP"
- X.EX "roff file" "Run off \fIfile\fP"
- X.EX "roff +5 file" "Run off \fIfile\fP starting at page 5"
- X.PP
- X.I Roff
- Xis a text formatter.
- XIts input consists of the text to be output, intermixed with formatting commands.
- XA formatting command is a line containing the control character followed by
- Xa two character command name, and possibly one or more arguments.
- XThe control character is initially \*(OQ.\*(CQ (dot).
- XThe formatted output is produced on standard output.
- X.PP
- XThe formatting commands are listed below, with
- X.I n
- Xbeing a number,
- X.I c
- Xbeing a character, and
- X.I t
- Xbeing a title.
- XA + before \fIn\fP means it may be signed, indicating a positive or negative
- Xchange from the current value.
- XInitial values for
- X.I n ,
- Xwhere relevant, are given in parentheses.
- X.HS
- X.ta 0.25i 1i
- X.nf
- X \fB.ad\fP Adjust right margin.
- X \fB.ar\fP Arabic page numbers.
- X \fB.br\fP Line break. Subsequent text will begin on a new line.
- X \fB.bl\fP n Insert \fIn\fP blank lines.
- X \fB.bp\fP +n Begin new page and number it \fIn\fP. No \fIn\fP means +1.
- X \fB.cc\fP c Control character is set to \fIc\fP.
- X \fB.ce\fP n Center the next \fIn\fP input lines.
- X \fB.de\fP zz Define a macro called \fIzz\fP. A line with \*(OQ..\*(CQ ends definition.
- X \fB.ds\fP Double space the output. Same as \fB.ls 2\fP.
- X \fB.ef\fP t Even page footer title is set to \fIt\fP.
- X \fB.eh\fP t Even page header title is set to \fIt\fP.
- X \fB.fi\fP Begin filling output lines as full as possible.
- X \fB.fo\fP t Footer titles (even and odd) are set to \fIt\fP.
- X \fB.hc\fP c The character \fIc\fP (e.g., %) tells \fIroff\fP where hyphens are permitted.
- X \fB.he\fP t Header titles (even and odd) are set to \fIt\fP.
- X \fB.hx\fP Header titles are suppressed.
- X \fB.hy\fP n Hyphenation is done if \fIn\fP is 1, suppressed if it is 0. Default is 1.
- X \fB.ig\fP Ignore input lines until a line beginning with \*(OQ..\*(CQ is found.
- X \fB.in\fP n Indent \fIn\fP spaces from the left margin; force line break.
- X \fB.ix\fP n Same as \fI.in\fP but continue filling output on current line.
- X \fB.li\fP n Literal text on next \fIn\fP lines. Copy to output unmodified.
- X \fB.ll\fP +n Line length (including indent) is set to \fIn\fP (65).
- X \fB.ls\fP +n Line spacing: \fIn\fP (1) is 1 for single spacing, 2 for double, etc.
- X \fB.m1\fP n Insert \fIn\fP (2) blank lines between top of page and header.
- X \fB.m2\fP n Insert \fIn\fP (2) blank lines between header and start of text.
- X \fB.m3\fP n Insert \fIn\fP (1) blank lines between end of text and footer.
- X \fB.m4\fP n Insert \fIn\fP (3) blank lines between footer and end of page.
- X \fB.na\fP No adjustment of the right margin.
- X \fB.ne\fP n Need \fIn\fP lines. If fewer are left, go to next page.
- X \fB.nn\fP +n The next \fIn\fP output lines are not numbered.
- X \fB.n1\fP Number output lines in left margin starting at 1.
- X \fB.n2\fP n Number output lines starting at \fIn\fP. If 0, stop numbering.
- X \fB.ni\fP +n Indent line numbers by \fIn\fP (0) spaces.
- X \fB.nf\fP No more filling of lines.
- X \fB.nx\fP f Switch input to file \fIf\fP.
- X \fB.of\fP t Odd page footer title is set to \fIt\fP.
- X \fB.oh\fP t Odd page header title is set to \fIt\fP.
- X \fB.pa\fP +n Page adjust by \fIn\fP (1). Same as .bp
- X \fB.pl\fP +n Paper length is \fIn\fP (66) lines.
- X \fB.po\fP +n Page offset. Each line is started with \fIn\fP (0) spaces.
- X \fB.ro\fP Page numbers are printed in Roman numerals.
- X \fB.sk\fP n Skip \fIn\fP pages (i.e., make them blank), starting with next one.
- X \fB.sp\fP n Insert \fIn\fP blank lines, except at top of page.
- X \fB.ss\fP Single spacing. Equivalent to .ls 1.
- X \fB.ta\fP Set tab stops, e.g., .ta 9 17 25 33 41 49 57 65 73 (default).
- X \fB.tc\fP c Tabs are expanded into \fIc\fP. Default is space.
- X \fB.ti\fP n Indent next line \fIn\fP spaces; then go back to previous indent.
- X \fB.tr\fP ab Translate \fIa\fP into \fIb\fP on output.
- X \fB.ul\fP n Underline the letters and numbers in the next \fIn\fP lines.
- X.fi
- X
- X
- X
- /
- echo x - rsh
- sed '/^X/s///' > rsh << '/'
- X.CD "rsh \(en remote shell for networking [IBM]"
- X.SX "rsh [\fB\(enbei\fR] \fIport\fR"
- X.FL "\(enb" "Start the rsh in the background"
- X.FL "\(ene" "Keep \fIstderr\fR separate from \fIstdout\fR"
- X.FL "\(eni" "Take input from the local process"
- X.EX "rsh machine5 "ls \(enl /usr/bin"" "List remote \fIbin\fR directory"
- X.EX "rsh abc cat /usr/doc/f >f" "Fetch remote file"
- X.EX "rsh foobar" "Log onto remote machine"
- X.PP
- XThe remote shell command is the way to have a distant server carry out
- Xa command over the Ethernet. The port given as the first argument can be
- Xany string of up to 6 characters, but it must match the port used by some
- Xsherver. The command will be executed and the results returned on \fIstdout\fR.
- XUnless the \fB\(ene\fR flag is given, the remote
- X\fIstderr\fR and \fIstdout\fR are merged onto the
- Xlocal \fIstdout\fR. Giving
- X\fIrsh\fR with just a port and no argument is the standard way
- Xto log onto a remote machine.
- X
- X
- X
- /
- echo x - rz
- sed '/^X/s///' > rz << '/'
- X.CD "rz \(en receive a file using the zmodem protocol"
- X.SX "rz\fR [\(en\fBabepqvy\fR]\fR [\fB\(ent \fItimeout\fR]
- X.FL "\(ena" "CP/M to UNIX conventions"
- X.FL "\(enb" "Binary file"
- X.FL "\(ene" "Escape for all control characters"
- X.FL "\(enp" "Protect file if it already exists"
- X.FL "\(enq" "Quiet; opposite of verbose"
- X.FL "\(ent" "Set \fItimeout\fR in tenths of a second"
- X.FL "\(env" "Verbose; opposite of quiet"
- X.FL "\(eny" "Yes, clobber existing files"
- X.EX "rz </dev/tty1 >/dev/tty1" "Receive a file"
- X.PP
- X\fIRz\fR is a program that accepts a file sent from another computer using the
- Xzmodem protocol.
- XIt is a highly complex program.
- XSee Chap 9 for more details.
- X
- X
- X
- X.SP 1
- /
- echo x - sed
- sed '/^X/s///' > sed << '/'
- X.CD "sed \(en stream editor"
- X.SX "sed\fR [\fB\(enegn\fR]\fR [\fB\(enf \fIscript_file\fR]\fR [\fIedit_script\fR] [\fIfile\fR]"
- X.FL "\(ene" "Accept multiple commands commands on the commands line"
- X.FL "\(enf" "The following argument contains the edit script"
- X.FL "\(eng" "Set the global flag on all substitute commands"
- X.FL "\(enn" "Only output selected lines"
- X.EX "sed \(enf script <file" "Run a sed script on \fIfile\fR"
- X.EX "sed \(fm/pig/s//hog/g\(fm <file" "Replace \fIpig\fR by \fIhog\fR in the file"
- X.PP
- X\fISed\fR is a stream editor.
- XIt takes an edit script either from its argument or a file, and performs
- Xan edit session on a named file or \fIstdin\fR, producing output
- Xon \fIstdout\fR.
- X
- X
- X
- X.SP 1
- /
- echo x - settype
- sed '/^X/s///' > settype << '/'
- X.CD "settype \(en set type and/or creator of a Mac file [MACINTOSH]"
- X.SX "settype \fR [\fB\(enc \fRcreator] [\fB\(ent \fRtype] \fIfile\fR"
- X.FL "\(enc" "Set the creator flag"
- X.FL "\(ent" "Set the type flag"
- X.EX "settype vol:dir:f" "Show the type and creator flags of file \fIf\fR"
- X.EX "settype -t TEXT vol:f" "Set the type of the file \fIf\fR to TEXT"
- X.PP
- X.I Settype
- Xwill report or set the creator and/or type of the specified Macintosh file.
- X
- X
- X
- X.SP 2
- /
- echo x - sh
- sed '/^X/s///' > sh << '/'
- X.CD "sh \(en shell"
- X.SX "sh\fR [\fIfile\fR]"
- X.FL "\fR(none)"
- X.EY "sh < script" "Run a shell script"
- X.PP
- X.I Sh
- Xis the shell.
- XIt permits redirection of input and output, pipes, magic characters,
- Xbackground processes, shell scripts and most of the other features of
- Xthe V7 (Bourne) shell.
- XA few of the more common commands are listed below:
- X.nf
- X.ta 2i 2.5i 3i
- X.HS
- X.in +0.25i
- Xdate # Regular command
- Xsort <file # Redirect \fIstdin\fR
- Xsort <file1 >file2 # Redirect \fIstdin\fR and \fIstdout\fR
- Xcc file.c 2>error # Redirect \fIstderr\fR
- Xa.out >f 2>&1 # Combine standard output and standard error
- Xsort <file1 >>file2 # Append output to \fIfile2\fR
- Xsort <file1 >file2 & # Background job
- X(ls \(enl; a.out) & # Run two background commands sequentially
- Xsort <file | wc # Two-process pipeline
- Xsort <f | uniq | wc # Three-process pipeline
- Xls \(enl *.c # List all files ending in \fI.c\fR
- Xls \(enl [\fIa-c\fR]* # List all files beginning with \fIa\fR, \fIb\fR, or \fIc\fR
- Xls \(enl ? # List all one-character file names
- Xls \\? # List the file whose name is question mark
- Xls \(fm???\(fm # List the file whose name is three question marks
- Xv=/usr/ast # Set shell variable \fIv\fR
- Xls \(enl $v # Use shell variable \fIv\fR
- XPS1=\(fmHi! \(fm # Change the primary prompt to \fIHi!\fR
- XPS2=\(fmMore: \(fm # Change the secondary prompt to \fIMore:\fR
- Xls \(enl $HOME # List the home directory
- Xecho $PATH # Echo the search path
- Xif ... then ... else ... fi # If statement
- Xfor ... do ... done # Iterate over argument list
- Xwhile ... do ... done # Repeat while condition holds
- Xcase ... in ... esac # Select clause based on condition
- Xecho $? # Echo exit status of previous command
- Xecho $$ # Echo shell's pid
- Xecho $# # Echo number of parameters (shell script)
- Xecho $2 # Echo second parameter (shell script)
- Xecho $* # Echo all parameters (shell script)
- X.in -0.25i
- X.fi
- X
- X
- X
- /
- echo x - shar
- sed '/^X/s///' > shar << '/'
- X.CD "shar \(en shell archiver"
- X.SX "shar \fIfile ..."
- X.FL "\fR(none)"
- X.EX "shar *.c >s" "Collect C programs in shell archive"
- X.EX "sh <s" "Extract files from a shell archive"
- X.PP
- XThe named files are collected together into a shell archive written onto
- Xstandard output.
- XThe individual files can be extracted by redirecting the shell archive into
- Xthe shell.
- XThe advantage of
- X.I shar
- Xover
- X.I ar
- Xis that \fIshar\fP archives can be read on almost any
- X.UX
- Xsystem, whereas numerous, incompatible versions of
- X.I ar
- Xare in widespread use.
- XExtracting the files from a shell archive requires that
- X.I sed
- Xbe accessible.
- X
- X
- X
- /
- echo x - sherver
- sed '/^X/s///' > sherver << '/'
- X.CD "sherver \(en shell server [IBM]"
- X.SX "sherver \fIport"
- X.FL "\fR(none)"
- X.EY "sherver machine1" "Start a sherver listening to \fIport\fR"
- X.PP
- XThe \fIrsh\fR command does its remote execution by doing a remote
- Xprocedure call to some sherver.
- XThe sherver executes the command and then exits. Usually a
- Xmaster will be running to make a new one. Because shervers get their input
- Xfrom a pipe, remote execution cannot handle signals and CTRL-D, because they
- Xcannot be sent down a pipe.
- X
- X
- X
- /
- echo x - size
- sed '/^X/s///' > size << '/'
- X.CD "size \(en print text, data, and bss size of a program"
- X.SX "size\fR [\fIfile\fR] ..."
- X.FL "\fR(none)"
- X.EY "size file" "Print the size of \fIfile\fP"
- X.PP
- XThe text, data, bss, and total sizes for each argument are printed.
- XIf no arguments are present,
- X.I a.out
- Xis assumed.
- XThe amount of memory available for combined stack and data segment growth
- Xis printed in the column \*(OQstack.\*(CQ
- XThis is the value manipulated by the
- X.I chmem
- Xcommand.
- XThe total amount of memory allocated to the program when it is loaded is
- Xlisted under \*(OQmemory.\*(CQ
- XThis value is just the sum of the other four columns.
- X
- X
- X
- /
- echo x - sleep
- sed '/^X/s///' > sleep << '/'
- X.CD "sleep \(en suspend execution for a given number of seconds"
- X.SX "sleep \fIseconds"
- X.FL "\fR(none)"
- X.EY "sleep 10" "Suspend execution for 10 sec."
- X.PP
- XThe caller is suspended for the indicated number of seconds.
- XThis command is typically used in shell scripts.
- X
- X
- X
- /
- echo x - sort
- sed '/^X/s///' > sort << '/'
- X.CD "sort \(en sort a file of ASCII lines"
- X.SX "sort\fR [\fB\(enbcdf\&imnru\fR]\fR [\fB\(ent\fIc\fR] [\fB\(eno \fIname\fR] [\fB+\fIpos1\fR] [\fB\(en\fIpos2\fR] \fIfile\fR ..."
- X.FL "\(enb" "Skip leading blanks when making comparisons"
- X.FL "\(enc" "Check to see if a file is sorted"
- X.FL "\(end" "Dictionary order: ignore punctuation"
- X.FL "\(enf" "Fold upper case onto lower case"
- X.FL "\(eni" "Ignore nonASCII characters"
- X.FL "\(enm" "Merge presorted files"
- X.FL "\(enn" "Numeric sort order"
- X.FL "\(eno" "Next argument is output file"
- X.FL "\(enr" "Reverse the sort order"
- X.FL "\(ent" "Following character is field separator"
- X.FL "\(enu" "Unique mode (delete duplicate lines)"
- X.EX "sort \(ennr file" "Sort keys numerically, reversed"
- X.EX "sort +2 \(en4 file" "Sort using fields 2 and 3 as key"
- X.EX "sort +2 \(ent: \(eno out" "Field separator is \fI:\fP"
- X.EX "sort +.3 \(en.6" "Characters 3 through 5 form the key"
- X.PP
- X.I Sort
- Xsorts one or more files.
- XIf no files are specified, \fIstdin\fR is sorted.
- XOutput is written on standard output, unless \fB\(eno\fP is specified.
- XThe options \fB+\fIpos1 \fB\(en\fIpos2\fR use only fields \fIpos1\fR
- Xup to but not including \fIpos2\fR as the sort key, where a field is a
- Xstring of characters delimited by spaces and tabs, unless a different field
- Xdelimiter is specified with \fB\(ent\fR.
- XBoth \fIpos1\fR and \fIpos2\fR have the form \fIm.n\fR where \fIm\fR tells
- Xthe number of fields and \fIn\fR tells the number of characters.
- XEither \fIm\fR or \fIn\fR may be omitted.
- X
- X
- X
- /
- echo x - spell
- sed '/^X/s///' > spell << '/'
- X.CD "spell \(en print all words in a file not present in the dictionary"
- X.SX "spell \fIfile"
- X.FL "\fR(none)"
- X.EY "spell document" "Print the spelling errors on \fIstdout\fR"
- X.PP
- X\fISpell\fR is the
- X.MX
- Xspelling checker.
- XIt is actually a short shell script.
- XFirst, the program \fIprep\fR strips off the \fIroff\fR,
- X\fInroff\fR, and \fItroff\fR control lines,
- Xand the punctuation, and lists each word on a separate line. These words are
- Xthen sorted. The resulting output is then compared to the dictionary. Words
- Xpresent in the file but not present in the dictionary are listed. The
- Xdictionary must be located in \fI/usr/lib/dictionary\fR.
- X
- X
- X
- /
- echo x - split
- sed '/^X/s///' > split << '/'
- X.CD "split \(en split a large file into several smaller files"
- X.SX "split\fR [\fB\(en\fIn\fR]\fR [\fIfile \fR[\fIprefix\fR]\fR]"
- X.FL "\(en\fIn\fP" "Number of lines per piece (default: 1000)"
- X.EX "split \(en200 file" "Split \fIfile\fP into pieces of 200 lines each"
- X.EX "split file z" "Split \fIfile\fP into \fIzaa\fP, \fIzab\fP, etc."
- X.PP
- X.I Split
- Xreads \fIfile\fP and writes it out in \fIn\fP-line pieces.
- XBy default, the pieces are called \fIxaa\fP, \fIxab\fP, etc.
- XThe optional second argument can be used to provide an alternative
- Xprefix for the output file names.
- X
- X
- X
- /
- echo x - strings
- sed '/^X/s///' > strings << '/'
- X.CD "strings \(en print all the strings in a binary file"
- X.SX "strings\fR [\fB\(en\fR] [\fB\(eno\fR]\fR [\fB\(en\fIn\fR] \fIfile ..."
- X.FL "\(en" "search whole file, not just data seg"
- X.FL "\(eno" "Print octal offset of each string"
- X.FL "\(en\fIn" "\fIn\fR is minimum length string (default = 4)"
- X.EX "strings \(en5 a.out" "Print the strings > 4 chars in \fIa.out\fR"
- X.EX "strings \(en /bin/sh" "Search entire shell file (text and data)"
- X.PP
- X\fIStrings\fR looks for sequences of ASCII characters followed by a zero
- Xbyte.
- XThese are usually strings. This program is typically used to help identify
- Xunknown binary programs
- X
- X
- X
- X.SP 1.5
- /
- echo x - strip
- sed '/^X/s///' > strip << '/'
- X.CD "strip \(en remove symbol table from executable file"
- X.SX "strip\fR [\fIfile\fR] ..."
- X.FL "\fR(none)"
- X.EY "strip a.out" "Remove symbols from \fIa.out\fR"
- X.PP
- XFor each file argument, \fIstrip\fR removes the symbol table.
- XStrip makes a copy of the file being stripped, so links are lost.
- X
- X
- X
- X.SP 1.5
- /
- echo x - stterm
- sed '/^X/s///' > stterm << '/'
- X.CD "stterm \(en turn system into a dumb terminal [68000]"
- X.SX "stterm \fR[\fB\(ens \fIspeed\fR] [\fB\(enl \fIline\fR] [\fB\(ene \fIescapechar\fR]"
- X.FL "\(ens" "Specify speed (default is 9600 baud)"
- X.FL "\(enl" "Specify line (default is /dev/tty1)"
- X.FL "\(ene" "Redefine escape character (default is tilde)"
- X.EY "stterm \(ens 1200" "Talk to /dev/tty1 at 1200 baud"
- X.PP
- X.I Stterm
- Xallows
- X.MX
- Xto talk to a terminal or modem over an RS232 line.
- XIt starts two other programs, a reader and a writer.
- XThe reader monitors the RS232 line and copies all characters to the
- Xscreen, while the writer monitors the keyboard and copies all
- Xcharacters to the RS232 line.
- X.PP
- XSince all characters are transferred to the RS232 line, a special
- Xescape character is present to control the behaviour of
- X.I stterm
- Xitself.
- XBy default the escape character is the \(ap character, but it can be
- Xredefined using the \fB\(ene\fR flag.
- XIf the escape character is followed by a period or a CTRL-D
- Xcharacter, the program terminates.
- XIf the escape character is followed by an ! (exclamation mark)
- Xa subshell is started.
- XTo transmit the escape character, enter it twice.
- XAn escape character followed by something other than CTRL-D, period,
- Xexclamation mark, or another escape character is invalid and generates
- Xan error message.
- X
- X
- X
- /
- echo x - stty
- sed '/^X/s///' > stty << '/'
- X.CD "stty \(en set terminal parameters"
- X.SX "stty\fR [\fIoption ...\fR]
- X.FL "\fR(none)"
- X.EX "stty \(enecho" "Suppress echoing of input"
- X.EX "stty erase #" "Set the erase character to \fI#\fP"
- X.PP
- XWhen given no arguments,
- X.I stty
- Xprints the current terminal parameters.
- XIt can also be used to set the parameters, as follows:
- X.ta 0.25i 1i
- X.HS
- X \fBcbreak\fP \(en Enter \fIcbreak\fP mode; erase and kill disabled
- X.br
- X \fBecho\fP \(en Echo input on the terminal
- X.br
- X \fBnl\fP \(en Accept only line feed to end lines
- X.br
- X \fBraw\fP \(en Enter \fIraw\fP mode; no input processing at all
- X.br
- X \fBtabs\fP \(en Output tabs (do not expand to spaces)
- X.br
- X \fBerase\fR c \(en Set erase character (initially backspace)
- X.br
- X \fBint\fR c \(en Set interrupt (SIGINT) character (initially DEL)
- X.br
- X \fBkill\fR c \(en Set kill line character (initially @)
- X.br
- X \fBquit\fR c \(en Set quit (SIGQUIT) character (initially CTRL-\\)
- X.br
- X \fBeven\fR \(en Use even parity
- X.br
- X \fBodd\fR \(en Use odd parity
- X.br
- X \fB[5-8]\fR \(en Number of bits per character
- X.br
- X \fB[110-9600]\fR \(en Baud rate
- X.br
- X \fBdefault\fR \(en Set options back to original values
- X.HS
- XThe first five options may be prefixed by \fB\(en\fP as in \fB\(entabs\fP
- Xto turn the option off.
- XThe next four options each have a single character parameter separated by a
- Xspace from the option.
- XThe \fBdefault\fR option sets the mode and the four settable characters back
- Xto the values they had when the system was booted.
- XIt is useful when a rogue program has messed them up.
- X
- X
- X
- X.SP 2.0
- /
- echo x - su
- sed '/^X/s///' > su << '/'
- X.CD "su \(en temporarily log in as superuser or another user"
- X.SX "su\fR [\fIname\fR]"
- X.FL "\fR(none)"
- X.EX "su~~~~" "Become superuser"
- X.EX "su ast" "Become \fIast\fR"
- X.PP
- X.I Su
- Xcan be used to temporarily login as another user.
- XIt prompts for the superuser password.
- XIf the correct password is entered,
- X.I su
- Xcreates a shell with the desired uid.
- XIf no name is specified, \fIroot\fR is assumed.
- XTo exit the temporary shell, type CTRL-D.
- XWhen memory is tight, it is better to become superuser by logging out and
- Xthen logging in again as \fIroot\fR, rather than using \fIsu\fR since the
- Xlatter creates an extra shell in memory.
- X
- X
- /
- echo x - sum
- sed '/^X/s///' > sum << '/'
- X.CD "sum \(en compute the checksum and block count of a file"
- X.SX "sum \fIfile"
- X.FL "\fR(none)"
- X.EX "sum /user/ast/xyz" "Checksum \fI/user/ast/xyz"
- X.PP
- X.I Sum
- Xcomputes the checksum of one or more files.
- XIt is most often used to see if a file copied from another machine has
- Xbeen correctly received.
- XThis program works best when both machines use the same checksum algorithm.
- XSee also \fIcrc\fR.
- X
- X
- X
- X.SP 2
- /
- echo x - svc
- sed '/^X/s///' > svc << '/'
- X.CD "svc \(en shell version control system"
- X.SX "ci\fR [\fB\(enlu\fR]\fR \fIfile"
- X.SX "co\fR [\fB\(enl\fR]\fR [\fB\(enr \fIrev\fR] \fIfile"
- X.SX "svc \fIfile"
- X.FL "\(enl" "For \fIci\fR, checkin, checkout again, and lock file"
- X.FL "\(enl" "For \fIco\fR, checkout file and then lock the archive"
- X.FL "\(enu" "After checking in, do not delete the file"
- X.FL "\(enr" "Check out revision \fIrev\fR instead most recent revision
- X.EX "ci \(enu file" "Check in \fIfile\fR"
- X.EX "co \(enl file" "Check out \fIfile\fR and lock archive"
- X.EX "co \(enr 2 file" "Check out version 2"
- X.PP
- X\fISvc\fR is the Shell Version Control system, patterned on RCS.
- XIt maintains a sequence of versions in archive files, so that new versions
- Xcan be checked in (added to the archive), and old versions can be checked
- Xout (made available).
- XTo create an archive for \fIfile\fR, check it in with the \fB\(enu\fR flag.
- XThis action will prompt for a log message and then create an archive called
- X\fIfile,S\fR in the current directory, or in the subdirectory \fISVC\fR if
- Xit exists.
- XThe file will not be deleted, but will be made unwritable.
- X.PP
- XTo update the file, check it out with the \fB\(enl\fR flag.
- XThen modify it, and check it back in, giving a new message when prompted.
- XAfter this process has been repeated many times, the archive will contain
- Xthe entire history.
- XAny version can be checked out using the \fB\(enr\fR flag.
- XTo get a printout of the history, use \fIsvclog\fR.
- X
- X
- X
- /
- echo x - sync
- sed '/^X/s///' > sync << '/'
- X.CD "sync \(en flush the cache to disk"
- X.SX "sync"
- X.FL "\fR(none)"
- X.EY "sync" "Write out all modified cache blocks"
- X.PP
- X.MX
- Xmaintains a cache of recently used disk blocks.
- XThe
- X.I sync
- Xcommand writes any modified cache blocks back to the disk.
- XThis is essential before stopping the system, and should be done before
- Xrunning any
- X.I a.out
- Xprogram that might crash.
- X
- X
- X
- /
- echo x - sz
- sed '/^X/s///' > sz << '/'
- X.CD "sz \(en send a file using the zmodem protocol"
- X.SX "sz\fR [\fB\(enLNbdefnopqruvy+\fR]\fR [\fB\(enci \fIcommand\fR] [\fB\(enLl\fR n\fR] [\fB\(ent \fItimeout\fR]
- X.FL "\(enL" "Use \fIn\fR-byte packets"
- X.FL "\(enN" "Overwrite if source is newer/longer"
- X.FL "\(enb" "Binary file"
- X.FL "\(enc" "Send command for execution"
- X.FL "\(end" "Convert dot to slash in names"
- X.FL "\(ene" "Escape for all control characters"
- X.FL "\(enf" "Send full path name"
- X.FL "\(eni" "Send command and return immediately"
- X.FL "\(enl" "Flow control every \fIn\fR packets"
- X.FL "\(enn" "Overwrite destination if source is newer"
- X.FL "\(eno" "Use old (16-bit) checksum"
- X.FL "\(enp" "Protect file if it already exists"
- X.FL "\(enq" "Quiet; opposite of verbose"
- X.FL "\(enr" "Resume interrupt file transfer"
- X.FL "\(ent" "Set \fItimeout\fR in tenths of a second"
- X.FL "\(enu" "Unlink file after successful transmission"
- X.FL "\(env" "Verbose; opposite of quiet"
- X.FL "\(eny" "Yes, clobber existing files"
- X.FL "\(en+" "Append to an existing file"
- X.EY "sz file </dev/tty1 >/dev/tty1" "Send \fIfile\fR"
- X.PP
- XXMODEM, YMODEM, and ZMODEM are a family of protocols that are widely used
- Xis the \s-2MS-DOS\s0 world for transferring information reliably from one
- Xcomputer to another. In all of these protocols, a series of bytes are sent
- Xfrom one computer to the other, and then an acknowledgement is sent back
- Xto confirm correct reception. Checksums are used to detect errors so that
- Xtransmission is reliable even in the face of noisy telephone lines.
- X\fISz\fR is a program that sends a file sent from another computer using the
- Xzmodem protocol.
- XThe file can be received using \fIrz\fR.
- XBoth are a highly complex programs.
- XSee Chap. 9 for more information.
- XFor an alternative, see \fIkermit\fR.
- X
- X
- X
- /
- echo x - tail
- sed '/^X/s///' > tail << '/'
- X.CD "tail \(en print the last few lines of a file"
- X.SX "tail\fR [\fB\(enc \fIn\fR] [\fB\(enf] [\fB\(enn \fIn\fR] [\fIfile\fR] ..."
- X.FL "\(enc" "The count refers to characters"
- X.FL "\(enf" "On FIFO or special file, keep reading after EOF"
- X.FL "\(enn" "The count refers to lines"
- X.EX "tail \(enn 6" "Print last 6 lines of \fIstdin\fR"
- X.EX "tail \(enc 20 file" "Print the last 20 characters of \fIfile\fR"
- X.EX "tail \(enn 1 file1 file2" "Print last line of two files"
- X.EX "tail \(enn +8 file" "Print the tail starting with line 8"
- X.PP
- XThe last few lines of one or more files are printed.
- XThe default count is 10 lines.
- XThe default file is \fIstdin\fR.
- XIf the value of \fIn\fR for the \fB\(enc\fR or \fB\(enn\fR flags starts with
- Xa + sign, counting starts at the beginning, rather than the end of the file.
- X
- X
- X
- /
- echo x - tar
- sed '/^X/s///' > tar << '/'
- X.CD "tar \(en tape archiver"
- X.SX "tar\fR [\fBFcotvx\fR]\fR [\fBf\fR] \fItarfile \fIfile ...
- X.FL "F" "Force tar to continue after an error"
- X.FL "c" "Create a new archive; add named files"
- X.FL "o" "Set uid/gid to original values on extraction"
- X.FL "f" "Next argument is name of tarfile"
- X.FL "t" "Print a table listing the archive's contents"
- X.FL "v" "Verbose mode-tell what is going on as it happens"
- X.FL "x" "The named files are extracted from the archive"
- X.EX "tar c /dev/fd1 ." "Back up current directory to \fI/dev/fd1\fR"
- X.EX "tar xv /dev/fd1 file1 file2" "Extract two files from the archive"
- X.EX "tar cf \(en | (cd dest; tar xf \(en)" "Copy current directory to \fIdest\fR"
- X.PP
- X\fITar\fR is a POSIX-compatible archiver, except that it does not use tape.
- XIt's primary advantage over
- X.I ar
- Xis that the
- X.I tar
- Xformat is somewhat more standardized than the
- X.I ar
- Xformat, making it theoretically possible to transport
- X.MX
- Xfiles to another computer, but do not bet on it.
- XIf the target machine runs
- X.SY MS-DOS ,
- Xtry
- X.I doswrite .
- X
- X
- X
- /
- echo x - tee
- sed '/^X/s///' > tee << '/'
- X.CD "tee \(en divert \fIstdin\fP to a file"
- X.SX "tee\fR [\fB\(enai\fR] \fIfile\fR ..."
- X.FL "\(ena" "Append to the files, rather than overwriting"
- X.FL "\(eni" "Ignore interrupts"
- X.EX "cat file1 file2 | tee x" "Save and display two files"
- X.EX "pr file | tee x | lpr" "Save the output of \fIpr\fP on \fIx\fP"
- X.PP
- X.I Tee
- Xcopies \fIstdin\fR to standard output.
- XIt also makes copies on all the files listed as arguments.
- X
- X
- X
- /
- echo x - term
- sed '/^X/s///' > term << '/'
- X.CD "term \(en turn PC into a dumb terminal [IBM]"
- X.SX "term\fR [\fIbaudrate\fR]\fR [\fIparity\fR] [\fIbits_per_character\fR]"
- X.FL "\fR(none)"
- X.EX "term 2400" "Talk to modem at 2400 baud"
- X.EX "term 1200 7 even" "1200 baud, 7 bits/char, even parity"
- X.EX "term 8 9600" "9600 baud, 8 bits/char, no parity"
- X.PP
- X\fITerm\fR allows
- X.MX
- Xto talk to a terminal or modem over RS232
- Xport 1. The program first sets the baudrate, parity and character length,
- Xand then forks.
- XThe parent sits in a loop copying from \fIstdin\fR (usually the console's
- Xkeyboard), to the terminal or modem (\fI/dev/tty1\fR).
- XThe child sits in a loop
- Xcopying from the terminal or modem (\fI/dev/tty1\fR) to standard output.
- XThus when
- XRS232 port 1 is connected to a modem, every keystroke typed on the keyboard
- Xis sent to the modem, and every character arriving from the modem is displayed.
- XStandard input and output may be redirected, to provide a primitive file
- Xtransfer program, with no checking. To exit \fIterm\fR,
- Xhit the middle button on the numeric pad.
- XImportant note: to use \fIterm\fR, it is essential that
- X\fI/etc/ttys\fR is configured so
- Xthat there is no shell hanging on \fI/dev/tty1\fR.
- XIf there is, both the shell and
- Xterm will try to read from \fI/dev/tty1\fR, and nothing will work.
- X
- X
- X
- X.SP 0.5
- /
- echo x - termcap
- sed '/^X/s///' > termcap << '/'
- X.CD "termcap \(en print the current termcap entry"
- X.SX "termcap\fR [\fItype\fR]"
- X.FL "\fR(none)"
- X.EY "termcap" "Print the termcap entry"
- X.PP
- X\fITermcap\fR reads the /etc/termcap entry corresponding to the
- Xterminal type
- Xsupplied as the argument. If none is given, the current $TERM is used.
- XIt then prints out all the parameters that apply.
- X
- X
- X
- X.SP 0.5
- /
- echo x - test
- sed '/^X/s///' > test << '/'
- X.CD "test \(en test for a condition"
- X.SX "test \fIexpr"
- X.FL "\fR(none)"
- X.EY "test \(enr file" "See if file is readable"
- X.PP
- X\fITest\fR checks to see if files exist, are readable, etc. and returns
- Xan exit status of zero if true and nonzero if false. The legal operators are
- X.sp
- X.nf
- X.ta 0.5i 1.5i
- X \(enr file true if the file is readable
- X \(enw file true if the file is writable
- X \(enx file true if the file is executable
- X \(enf file true if the file is not a directory
- X \(end file true if the file is a directory
- X \(ens file true if the file exists and has a size > 0
- X \(ent fd true if file descriptor fd (default 1) is a terminal
- X \(enz s true if the string s has zero length
- X \(enn s true if the string s has nonzero length
- X s1 = s2 true if the strings s1 and s2 are identical
- X s1 != s2 true if the strings s1 and s2 are different
- X m \(eneq m true if the integers m and n are numerically equal
- X.fi
- X
- XThe operators \fB\(engt\fR, \fB\(enge\fR, \fB\(enne\fR, \fB\(enle\fR, and
- X\fB\(enlt\fR may be used as well.
- XThese operands may be combined with \fB\(ena\fR (Boolean and),
- X\fB\(eno\fR (Boolean or), !
- X(negation).
- XThe priority of \fB\(ena\fR is higher than that of \fB\(eno\fR.
- XParentheses are permitted, but must be escaped to keep the shell from trying
- Xto interpret them.
- X
- X
- X
- /
- echo x - time
- sed '/^X/s///' > time << '/'
- X.CD "time \(en report how long a command takes"
- X.SX "time \fIcommand"
- X.FL "\fR(none)"
- X.EX "time a.out" "Report how long \fIa.out\fR takes"
- X.EX "time ls \(enl *.c" "Report how long \fIls\fR takes"
- X.PP
- XThe command is executed and the real time, user time, and system time (in
- Xhours, minutes, and seconds) are printed.
- XShell scripts cannot be timed.
- X
- X
- X
- /
- echo x - to
- sed '/^X/s///' > to << '/'
- X.CD "to \(en output half of a connection [IBM]"
- X.SX "to \fIport"
- X.FL "\fR(none)"
- X.EY "cat f1 f2 | to mach4" "Send the catted files to port"
- X.PP
- X\fITo\fR and
- X\fIfrom\fR are used together to provide connection-oriented service.
- XOn the sending machine, the last member of a pipeline is \fIto port\fR.
- XOn the
- Xreceiving machine, the first member of a pipe line is \fIfrom port\fR. The net
- Xresult is that the output of the sending pipeline goes into the input of the
- Xreceiving pipeline, making pipelines work across the network. As a simple
- Xexample, consider:
- X.HS
- X.nf
- X on machine1: cat f1 f2 | to Johnny
- X on machine2: from Johnny | sort >x
- X.fi
- X.HS
- XThe effect of these two commands is that the files f1 and f2 are concatenated,
- Xtransferred to machine 2, and sorted there, with the output going to a file
- X\fIx\fR
- Xon machine 2. The string \fIJohnny\fR is used by
- Xthe transaction system to identify
- Xwhich sender goes with which receiver; any unique string can be used.
- XMultiple transfers may take place simultaneously between different pairs
- Xof machines on the same Ethernet.
- X
- X
- X
- /
- echo x - tos
- sed '/^X/s///' > tos << '/'
- X.CD "tos \(en list, read and write \s-2TOS\s0 file systems [ATARI]"
- X.SX "tos \(en[Radlrw] \fIdrive\fR [\fIfile\fR]"
- X.FL "\(enR" "Recursively descend directories when listing them"
- X.FL "\(ena" "Read or write ASCII file"
- X.FL "\(end" "Directory list"
- X.FL "\(enl" "Use long format for directory listing"
- X.FL "\(enr" "Read a \s-2TOS\s0 file into \s-2MINIX\s0"
- X.FL "\(enw" "Write a \s-2MINIX\s0" file to \s-2TOS\s0"
- X.EX "tos \(endl 1" "List root directory on /dev/fd1"
- X.EX "tos \(enr hd4 g/adv >adv" "Read file \fIg/adv\fR from \fI/dev/hd4\fR"
- X.EX "tos \(enwa /dev/fd0 f" "Copy ASCII \fIstdin\fR to \fIf\fR on \fI/dev/fd0\fR"
- X.PP
- X.I Tos
- Xknows about \s-2TOS\s0 file system structures on diskettes and hard disks.
- XIt can list directories and read and write files.
- XSlashes should be used in file names, even though \s-2TOS\s0 uses backslashes.
- XThe drive can be specified as number (in which case it is appended to
- X\fI/dev/fd\fR),
- Xas absolute path name (like \fI/dev/fd0\fR), or as suffix
- Xto \fI/dev/\fR (like \fIhd4\fR).
- XASCII files have the final CTRL-Z stripped, and \fITOS\fR carriage return
- Xplus line feed is mapped to
- X.MX
- Xline feed.
- X.I Tos
- Xmay be linked to
- X.I tosdir ,
- X.I tosread
- Xand
- X.I toswrite ,
- Xin which case the \fB\(end\fR, \fB\(enr\fR, and \fB\(enw\fR flags are not
- Xneeded.
- X
- X
- X
- /
- echo x - touch
- sed '/^X/s///' > touch << '/'
- X.CD "touch \(en update a file's time of last modification"
- X.SX "touch\fR [\fB\(enc\fR] \fIfile\fR ..."
- X.FL "\(enc" "Do not create the file"
- X.EY "touch *.h" "Make the \fI.h\fP files look recent"
- X.PP
- XThe time of last modification is set to the current time.
- XThis command is mostly used to trick
- X.I make
- Xinto thinking that a file is more recent than it really is.
- XIf the file being touched does not exist, it is created, unless the \fB\(enc\fR
- Xflag is present.
- X
- X
- X
- /
- echo x - tr
- sed '/^X/s///' > tr << '/'
- X.CD "tr \(en translate character codes"
- X.SX "tr\fR [\fB\(encds\fR]\fR [\fIstring1\fR] [\fIstring2\fR]"
- X.FL "\(enc" "Complement the set of characters in \fIstring1\fR"
- X.FL "\(end" "Delete all characters specified in \fIstring1\fR"
- X.FL "\(ens" "Squeeze all runs of characters in \fIstring1\fR to one character"
- X.EX "tr \(fm[a\(enz]\(fm \(fm[A\(enZ]\(fm <x >y~~~~~" "Convert upper case to lower case"
- X.EX "tr \(end \(fm0123456789\(fm <f1 >f2~~" "Delete all digits from \fIf1\fR"
- X.PP
- X.I Tr
- Xperforms simple character translation.
- XWhen no flag is specified, each character in
- X.I string1
- Xis mapped onto the corresponding character in
- X.I string2 .
- X
- X
- X
- /
- echo x - transfer
- sed '/^X/s///' > transfer << '/'
- X.CD "transfer \(en read, write and format diskettes [AMIGA]"
- X.SX "transfer \fR[\fB\(enf\fR] [\fB\(enr\fR] [\fB\(enw \fIfile\fR]"
- X.FL "\(enf" "Format a diskette (9 sectors/track)"
- X.FL "\(enr" "Read a file from a special diskette on \fIstdout\fR"
- X.FL "\(enw" "Write \fIfile\fR to a diskette"
- X.EX "transfer \(enf" "Format a diskette (9 sectors/track)"
- X.EX "transfer \(enr" "Read a file from a special diskette"
- X.EX "transfer \(enw /etc/passwd" "Write /etc/passwd to a special diskette"
- X.PP
- X.I Transfer
- Xreads and writes a file from and to a special diskette, one file per diskette.
- XThis diskette can only be used to transfer files from and to AmigaDOS,
- Xbecause nobody else can read it. Besides reading and writing diskettes,
- Xthe AmigaDOS version of
- X.I transfer
- Xcan also format diskettes using the \fB\(enf\fR option.
- XIf you already have
- Xan AmigaDOS program which can read and write diskettes you might
- Xalso use \fItos\fR to exchange files between
- X.MX
- Xand AmigaDOS.
- X.PP
- XA typical session to copy \fIminix.img\fR from
- X.MX
- Xto AmigaDOS might look like this:
- X.HS
- X.Cx "# transfer \(enw minix.img"
- X.HS
- X\fIMinix.img\fR will be written to diskette. When \fItransfer\fR is ready you
- Xcan log out, and reboot the Amiga. Hit CTRL-D to abort the
- Xstartup-sequence and type
- X.HS
- X.Cx "1> cd RAM:"
- X.br
- X.Cx "1> transfer \(enr"
- X.HS
- Xto read \fIminix.img\fR and type
- X.HS
- X.Cx "1> copy minix.img DF0:"
- X.HS
- Xto copy \fIminix.img\fR onto an AmigaDOS diskette.
- X.PP
- XImportant note: when \fItransfer\fR tells you to insert a special diskette
- Xand hit return, \fIdo not\fR do so before the drive LED has gone out,
- Xto prevent the Amiga from crashing.
- X
- X
- X
- /
- echo x - traverse
- sed '/^X/s///' > traverse << '/'
- X.CD "traverse \(en print directory tree under the named directory"
- X.SX "traverse \fIdir"
- X.FL "\fR(none)"
- X.EY "traverse ." "Print tree starting at working dir"
- X.PP
- X\fITraverse\fR prints the tree structure starting at the named directory.
- XAll the subdirectories are listed, with the depth shown by indentation.
- X
- X
- X
- X.SP 1
- /
- echo x - treecmp
- sed '/^X/s///' > treecmp << '/'
- X.CD "treecmp \(en recursively list differences in two directory trees"
- X.SX "treecmp\fR [\fB\(encv\fR] \fIolddir newdir"
- X.FL "\(enc" "(changes) list the names of changed or new files"
- X.FL "\(env" "(verbose) list all directories processed"
- X.EY "treecmp \(env /usr/ast/V1 /usr/ast/V2" "Compare two trees"
- X.PP
- X\fITreecmp\fR recursively descends the directory tree of its second
- Xargument and compares all files to those at the corresponding position in
- Xthe first argument.
- XIf the two trees are identical, i.e., all the corresponding
- Xdirectories and files are the same, there is no output. Otherwise, a list
- Xof files missing from one of the trees or present in both but whose contents
- Xare not identical in both are printed.
- XWhen the \fB\(enc\fR flag is given, only files that are changed from the old
- Xversion or are new (i.e., absent in the old version) are listed.
- X
- X
- X
- /
- echo x - true
- sed '/^X/s///' > true << '/'
- X.CD "true \(en exit with the value true"
- X.SX "true"
- X.FL "\fR(none)"
- X.EY "while true" "List the directory until DEL is hit"
- X.br
- X do ls \(enl
- X.br
- X done
- X.PP
- XThis command returns the value
- X.I true .
- XIt is used for shell programming.
- XThe program is in reality not a program at all.
- XIt is the null file.
- X
- X
- X
- X.SP 1.5
- /
- echo x - tset
- sed '/^X/s///' > tset << '/'
- X.CD "tset \(en set the $TERM variable"
- X.SX "tset\fR [\fIdevice\fR]"
- X.FL "\fR(none)"
- X.EY "eval \`tset\`" "Set TERM"
- X.PP
- X\fITset\fR is used almost exclusively to set the shell variable TERM from
- Xinside profiles. If an argument is supplied, that is used as the value of
- XTERM. Otherwise it looks in \fI/etc/ttytype\fR.
- X
- X
- X
- X.SP 1.5
- /
- echo x - tsort
- sed '/^X/s///' > tsort << '/'
- X.CD "tsort \(en topological sort [IBM]"
- X.SX "tsort \fIfile"
- X.FL "\fR(none)"
- X.EX "lorder *.s | tsort" "Give library ordering"
- X.EX "ar cr libc.a \`lorder *.s | tsort\`" "Build library"
- X.PP
- X\fITsort\fR accepts a file of lines containing ordered pairs and builds a
- Xtotal ordering from the partial orderings.
- X
- X
- X
- X.SP 1.5
- /
- echo x - ttt
- sed '/^X/s///' > ttt << '/'
- X.CD "ttt \(en tic tac toe"
- X.SX "ttt"
- X.FL "\fR(none)"
- X.EY "ttt~~~" "Start the game"
- X.PP
- XThis program allows the user to engage in a game of tic tac toe (noughts and
- Xcrosses) with the computer.
- XThe program uses the alpha-beta algorithm, so the user had better be sharp.
- X
- X
- X
- /
- echo x - tty
- sed '/^X/s///' > tty << '/'
- X.CD "tty \(en print the device name of this tty"
- X.SX "tty \fR[\fB\(ens\fR]"
- X.FL "\(ens" "Silent mode, only the exit status is affected."
- X.EY "tty~~~" "Print the tty name"
- X.PP
- XPrint the name of the controlling tty. If the flag \fB\(ens\fR is given,
- X\fItty\fR is equivalent to the call to \fIisatty()\fR.
- X
- X
- X
- /
- echo x - umount
- sed '/^X/s///' > umount << '/'
- X.CD "umount \(en unmount a mounted file system"
- X.SX "/etc/umount \fIspecial"
- X.FL "\fR(none)"
- X.EY "/etc/umount /dev/fd1" "Unmount diskette 1"
- X.PP
- XA mounted file system is unmounted after the cache has been flushed to disk.
- XA diskette should never be removed while it is mounted.
- XIf this happens, and is discovered before another diskette is inserted, the
- Xoriginal one can be replaced without harm.
- XAttempts to unmount a file system holding working directories or open files
- Xwill be rejected with a \*(OQdevice busy\*(CQ message.
- X
- X
- X
- /
- echo x - unexpand
- sed '/^X/s///' > unexpand << '/'
- X.CD "unexpand \(en convert spaces to tabs"
- X.SX "unexpand\fR [\fB\(ena\fR]
- X.FL "\(ena" "All spaces are unexpanded"
- X.EY "unexpand oldfile >newfile" "Convert leading spaces to tabs"
- X.PP
- X\fIUnexpand\fR replaces spaces in the named files with tabs.
- XIf no files are listed, \fIstdin\fR is given.
- XThe \fB\(ena\fR flag is used to force all sequences of spaces to be
- Xexpanded, instead of just leading spaces (the default).
- X
- X
- X
- /
- echo x - uniq
- sed '/^X/s///' > uniq << '/'
- X.CD "uniq \(en delete consecutive identical lines in a file"
- X.SX "uniq\fR [\fB\(encdu\fR]\fR [\fB\(en\fIn\fR] [\fB+\fIn\fR] [\fIinput [\fIoutput\fR]\fR]
- X.FL "\(enc" "Give count of identical lines in the input"
- X.FL "\(end" "Only duplicate lines are written to output"
- X.FL "\(enu" "Only unique lines are written to output"
- X.FL "\(en\fIn\fR" "Skip the first \fIn\fR columns when matching"
- X.FL "+\fIn\fR" "Skip the first \fIn\fR fields when matching"
- X.EX "uniq +2 file" "Ignore first 2 fields when comparing"
- X.EX "uniq \(end inf outf" "Write duplicate lines to \fIoutf\fP"
- X.PP
- X.I Uniq
- Xexamines a file for consecutive lines that are identical.
- XAll but duplicate entries are deleted, and the file is written to output.
- XThe +\fIn\fR option skips the first \fIn\fR fields, where a field is defined
- Xas a run of characters separated by white space.
- XThe \(en\fIn\fP option skips the first \fIn\fR spaces.
- XFields are skipped first.
- X
- X
- /
- echo x - unshar
- sed '/^X/s///' > unshar << '/'
- X.CD "unshar \(en Remove files from a shell archive"
- X.SX "unshar\fR [\fB\(enbtvx\fR] \fIsharfile \fImember ..."
- X.FL "\(enb" "Unshar brutally, overwriting files if need be"
- X.FL "\(ent" "Tell what is in the archive but do not extract"
- X.FL "\(env" "Verbose mode"
- X.FL "\(enx" "Extract only the members listed"
- X.EX "unshar arch.sh" "Extract all members of the archive"
- X.EX "unshar \(ent arch.sh" "List the contents of the archive"
- X.EX "unshar \(enxf1 \(enxf2 arch.sh" "Extract \fIf1\fR and \fIf2\fR from \fIarch.sh\fR"
- X.EX "uniq \(end inf outf" "Write duplicate lines to \fIoutf\fP"
- X.PP
- X.I Unshar
- Xextracts members of a shell archive, the same as \fIsh\fR, except much faster.
- XIt expects shell archives created with \fIshar.\fR
- XIt also has options to list the contents of a shell archive, and to selectively
- Xextract some members but not all.
- X
- X
- X
- /
- echo x - update
- sed '/^X/s///' > update << '/'
- X.CD "update \(en periodically write the buffer cache to disk"
- X.SX "/etc/update"
- X.FL "\fR(none)"
- X.EY "/etc/update &" "Start a process that flushes the cache"
- X.PP
- XWhen the system is booted,
- X.I update
- Xis started up in the background from
- X.I /etc/rc
- Xto issue a
- X.SY SYNC
- Xsystem call every 30 sec.
- X
- X
- X
- /
- echo x - users
- sed '/^X/s///' > users << '/'
- X.CD "users \(en list the logged-in users"
- X.SX "users"
- X.FL "\fR(none)"
- X.EY "users" "list the users"
- X.PP
- X\fIUsers\fR prints one line containing the names of all
- Xthe currently logged-in users.
- X
- X
- X
- /
- echo x - uud
- sed '/^X/s///' > uud << '/'
- X.CD "uud \(en decode a binary file encoded with uue"
- X.SX "uud\fR [\fB\(enn\fR]\fR [\fB\(ens \fIsrcdir\fR] [\fB\(ent \fIdstdir/\fR] \fIfile"
- X.FL "\(enn" "Do not verify checksums"
- X.FL "\(ens" "Name of directory where \fI.uue\fR file is"
- X.FL "\(ent" "Name of directory where output goes"
- X.EX "uud file.uue " "Re-create the original file"
- X.EX "uud \(en <file.uue" "The \(en means use \fIstdin\fR"
- X.PP
- X\fIUud\fR decodes a file encoded with \fIuue\fR or
- X.UX
- X\fIuuencode\fR.
- XThe decoded file is given the name that the original file had.
- XThe name information is part of the encoded file.
- XMail headers and other junk before the encoded file are skipped.
- X
- X
- X
- /
- echo x - uue
- sed '/^X/s///' > uue << '/'
- X.CD "uue \(en encode a binary file to ASCII (e.g., for mailing)"
- X.SX "uue\fR [\fB\(en\fIn\fR] \fIfile\fR [\fB\(en\fR]"
- X.FL "\(en\fIn\fR" "How many lines to put in each file"
- X.EX "uue file" "Encode \fIfile\fR to \fIfile.uue\fR"
- X.EX "uue file \(en >x" "Encode \fIfile\fR and write on \fIstdout\fR"
- X.EX "uue \(en800 file" "Output on \fIfile.uaa\fR, \fIfile.uab\fR etc."
- X.PP
- X\fIUuencode\fR is a famous program that converts an arbitrary (usually binary)
- Xfile to an encoding using only 64 ASCII characters.
- X\fIUudecode\fR converts it back to the original file.
- XThe \fIuue\fR and \fIuud\fR programs are the
- X.MX
- Xversions of these programs, and are compatible with the \s-2UNIX\s0 ones.
- XThe files produced can even be sent successfully over BITNET, which is
- Xnotorious for mangling files.
- XIt is possible to have \fIuue\fR automatically split the encoded file up
- Xinto small chunks.
- XThe output files then get the suffixes \fI.uaa\fR, \fI.uab\fR, etc., instead
- Xof \fI.uue\fR.
- XWhen \fIuud\fR is given \fIfile.uaa\fR to decode, it automatically includes
- Xthe subsequent pieces.
- XThe encoding takes 3 bytes (24 bits) from the input file and renders it
- Xas 4 bytes in the output file.
- X
- X
- X
- X.SP 2
- /
- echo x - virecover
- sed '/^X/s///' > virecover << '/'
- X.CD "virecover \(en recover from a crash"
- X.SX "virecover \fR[\fIfile\fR]"
- X.FL "\fR(none)"
- X.EY "virecover prog.c" "Recover \fIprog.c\fR
- X.PP
- X\fIVirecover\fR is used to recover an edit session after a crash.
- XBoth \fIelvis\fR and \fIex\fR keep a scratch files in \fI/usr/tmp\fR.
- XAfter an editor crash, this information is used to reconstruct the file.
- XIf \fIvirecover\fR is called with no file name, it expects one of these
- Xtemporary files on \fIstdin\fR.
- X
- X
- X
- X.SP 2
- /
- echo x - vol
- sed '/^X/s///' > vol << '/'
- X.CD "vol \(en split stdin into diskette-sized volumes"
- X.SX "vol\fR [\fB\(enu\fR] \fIsize block_special"
- X.FL "\(enu" "Unsave from diskettes"
- X.EX "tar c \(en . | vol 360 /dev/fd0" "Prompt for disk every 360K"
- X.EX "vol \(enu 360 /dev/fd0 | tar x \(en " "Restore a saved file system"
- X.PP
- XIt occasionally happens that a program generates an output stream intended
- Xfor diskette but the stream is to large to fit on one diskette. \fIVol\fP is a
- Xprogram that accepts such a stream, and pauses every \fIn\fR
- Xblocks to request a new diskette to be inserted.
- XThis makes it possible to save arbitrarily long
- Xstreams on a series of diskettes, as shown in the examples above.
- X
- X
- X
- /
- echo x - wc
- sed '/^X/s///' > wc << '/'
- X.CD "wc \(en count characters, words, and lines in a file"
- X.SX "wc\fR [\fB\(enclw\fR] \fIfile\fR ..."
- X.FL "\(enc" "Print character count"
- X.FL "\(enl" "Print line count"
- X.FL "\(enw" "Print word count"
- X.EX "wc file1 file2" "Print all three counts for both files"
- X.EX "wc \(enl file" "Print line count only"
- X.PP
- X.I Wc
- Xreads each argument and computes the number of characters, words and lines
- Xit contains.
- XA word is delimited by white space (space, tab, or line feed).
- XIf no flags are present, all three counts are printed.
- X
- X
- X
- X.SP 0.6
- /
- echo x - weidertc
- sed '/^X/s///' > weidertc << '/'
- X.CD "weidertc \(en set date from Weide real time clock [ATARI]"
- X.SX "weidertc [\(end]"
- X.FL "\(end" "Output some debugging information"
- X.EY "weidertc" "Set the date from the Weide real time clock"
- X.PP
- X.I Weidertc
- Xreads the current date and time from a Weide real time clock (if present)
- Xand sets the
- X.MX
- Xtime accordingly.
- XThis program is usually called from
- X.I /etc/rc .
- X
- X
- X
- X.SP 0.6
- /
- echo x - whatis
- sed '/^X/s///' > whatis << '/'
- X.CD "whatis \(en tell what the program does"
- X.SX "whatis \fIname ..."
- X.FL "\fR(none)"
- X.EY "whatis head" "Gives a summary of what the \fIhead\fR program does"
- X.PP
- X\fIWhatis\fR searches the \fI/usr/etc/whatis\fR database for the arguments.
- XFor each name, it prints the corresponding entry.
- X
- X
- X
- /
- echo x - whatsnew
- sed '/^X/s///' > whatsnew << '/'
- X.CD "whatsnew \(en print a newly modified file, marking changes"
- X.SX "whatsnew\fR [\fB\(en\fIn\fR] \fIfile.c file.c.cdif"
- X.FL "\(en\fIn\fR" "Output line length"
- X.EX "whatsnew file.c file.c.cdif~~~~~~" "Print \fIfile.c\fR with changes marked"
- X.EX "whatsnew \(en70 file.c file.c.cdif" "Same as above, but with 70 col line"
- X.PP
- XIt commonly occurs that \fIcdif\fRs are posted to USENET.
- XAfter installing a \fIcdif\fR file, it is sometimes desirable to print out
- Xthe new file, with the changes marked on it.
- X\fIWhatsnew\fR does precisely this, with the changes + and ! printed in the
- Xright-hand margin.
- X
- X
- X
- X.SP 0.6
- /
- echo x - whereis
- sed '/^X/s///' > whereis << '/'
- X.CD "whereis \(en examine system directories for a given file"
- X.SX "whereis \fIfile"
- X.FL "\fR(none)"
- X.EY "whereis stat.h" "Prints: \fI/usr/include/sys/stat.h\fR"
- X.PP
- X\fIWhereis\fR searches a fixed set of system
- Xdirectories, \fI/bin\fR, \fI/lib\fR, \fI/usr/bin\fR,
- Xand others, and prints all occurrences of the argument name in any of them.
- X
- X
- X
- /
- echo x - which
- sed '/^X/s///' > which << '/'
- X.CD "which \(en examine $PATH to see which file will be executed"
- X.SX "which \fIname"
- X.FL "\fR(none)"
- X.EY "which a.out" "Tells which \fIa.out\fR will be executed"
- X.PP
- XThe $PATH shell variable controls the
- X.MX
- Xsearch rules.
- XIf a command \fIa.out\fR is given, the shell first tries to find an
- Xexecutable file in the working directory.
- XIf that fails, it looks in various system directories, such as
- X\fI/bin\fR and \fI/usr/bin\fR.
- XThe\fR which\fR command makes the same search and gives the absolute
- Xpath of the program that will be chosen, followed by other occurrences
- Xof the file name along the path.
- X
- X
- X
- /
- echo x - who
- sed '/^X/s///' > who << '/'
- X.CD "who \(en print list of currently logged in users"
- X.SX "who\fR [\fIfile\fR]"
- X.FL "\fR(none)"
- X.EY "who " "Print user names, terminals and times"
- X.PP
- X\fIWho\fR prints a list of currently logged in users. For each one,
- Xthe user name, terminal, and login time is printed.
- XThis program gets its information from the file \fI/etc/utmp\fR, which
- Xis updated by init and login.
- XIf the file does not exist, neither of these will create it, and
- X\fIwho\fR will not work. Note that if you decide to create an empty
- X\fI/usr/adm/wtmp\fR to enable the login accounting, it will grow forever and
- Xeventually fill up your disk unless you manually truncate it from time to time.
- XIf an optional file name is provided, the logins in that file will be printed.
- X
- X
- X
- /
- echo x - whoami
- sed '/^X/s///' > whoami << '/'
- X.CD "whoami \(en print current user name"
- X.SX "whoami"
- X.FL "\fR(none)"
- X.EY "whoami" "Print user name"
- X.PP
- XIn case you forget who you are logged in as, \fIwhoami\fR will tell you. If
- Xyou use \fIsu\fR to become somebody else,
- X\fIwhoami\fR will give the current effective user.
- X
- X
- X
- /
- echo x - width
- sed '/^X/s///' > width << '/'
- X.CD "width \(en force all the lines of a file to a given width"
- X.SX "width\fR [\fB\(en\fIn\fR [ \fIinfile\fR [\fIoutfile\fR]\fR
- X.FL "\(en\fIn\fR" "Outline line size"
- X.EX "width \(en60 x y" "Copy \fIx\fR to \fIy\fR, force lines to 60 cols"
- X.EX "width x" "Copy default (80) column lines to \fIstdout\fR"
- X.PP
- XThe input file is copied to the output file.
- XAll lines are forced to a given size (default: 80 columns) by padding with
- Xspaces or truncating.
- XTabs are expanded to spaces.
- X
- X
- X
- /
- echo x - write
- sed '/^X/s///' > write << '/'
- X.CD "write \(en send a message to a logged-in user"
- X.SX "write\fR [\fB\(encv\fR] \fIuser\fR [\fItty\fR]
- X.FL "\(enc" "Use cbreak mode"
- X.FL "\(env" "Verbose mode"
- X.EX "write ast" "Send a message to ast"
- X.EX "write ast tty1" "Send a message to ast on tty1"
- X.PP
- X\fIWrite\fR lets a user send messages to another logged-in user.
- XLines typed by the user appear on the other user's screen a line at a time
- X(a character at a time in the case of cbreak mode).
- XThe file \fI/usr/adm/wtmp\fR is searched to determine which tty to send to.
- XIf the user is logged onto more than one terminal, the \fItty\fR argument
- Xselects the terminal. Type CTRL- D to terminate the command.
- XUse ! as a shell escape.
- /
-