Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!ast@cs.vu.nl From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: V1.4a #9 (helpfile, part 2 of 2) Message-ID: <1954@ast.cs.vu.nl> Date: 22 Jan 89 22:41:28 GMT Sender: ast@cs.vu.nl Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Organization: VU Informatica, Amsterdam Lines: 955 CTRL-B Move cursor backward to start of previous word 26 SCREEN MOTION Home key Move to first character of the file End key Move to last character of the file PgUp key Scroll window up 23 lines (closer to start of the file) PgDn key Scroll window down 23 lines (closer to end of the file) CTRL-U Scroll window up 1 line CTRL-D Scroll window down 1 line MODIFYING TEXT Del key Delete the character under the cursor Backspace Delete the character to left of the cursor CTRL-N Delete the next word CTRL-P Delete the previous word CTRL-T Delete tail of line (all characters from cursor to end of line) CTRL-O Open up the line (insert line feed and back up) CTRL-G Get and insert a file at the cursor position BUFFER OPERATIONS CTRL-@ Set mark at current position for use with CTRL-C and CTRL-K CTRL-C Copy the text between the mark and the cursor into the buffer CTRL-K Delete text between mark and cursor; also copy it to the buffer CTRL-Y Yank contents of the buffer out and insert it at the cursor CTRL-Q Write the contents of the buffer onto a file MISCELLANEOUS numeric + Search forward (prompts for regular expression) numeric - Search backward (prompts for regular expression) numeric 5 Display the file status CTRL-] Go to specific line CTRL-R Global replace _p_a_t_t_e_r_n with _s_t_r_i_n_g (from cursor to end) CTRL-L Line replace _p_a_t_t_e_r_n with _s_t_r_i_n_g CTRL-W Write the edited file back to the disk CTRL-X Exit the editor CTRL-S Fork off a shell (use CTRL-D to get back to the editor) CTRL-\ Abort whatever the editor was doing and wait for command CTRL-E Erase screen and redraw it CTRL-V Visit (edit) a new file #mkdir Command: mkdir - make a directory Syntax: mkdir directory ... Flags: (none) Examples: The specified directory or directories are created. The entries . and .. are inserted into the new directory. 27 #mkfs Command: mkfs - make a file system Syntax: mkfs special prototype Flags: -L Make a listing on standard output Examples: _M_k_f_s builds a file system and copies specified files to it. The prototype file tells which directories and files to copy to it. If the prototype file cannot be opened, and its name is just a string of digits, an empty file system will be made with the specified number of blocks. A sample prototype file fol- lows. comments are not allowed. The first entry on each line (except the first 3 and the $ lines, which ter- minate directories) is the name the file or directory will get on the new file system. Next comes its mode, with the first character being -dbc for regular files, directories, block special files and character special files, respec- tively. The next two characters are used to specify the SETUID and SETGID bits, as shown above. The last three characters of the mode are the _r_w_x protection bits. Following the mode are the uid and gid. For special files, the major and minor devices are needed. The size in blocks must also be specified for block special files (the MINIX block size is 1K; this can only be changed by changing _B_L_O_C_K__S_I_Z_E and then recompiling the operating system). #mknod Command: mknod - create a special file Syntax: mknod file [b] [c] major minor Flags: (none) Example: 28 _M_k_n_o_d creates a special file named _f_i_l_e, with the indicated major and minor device numbers. The second argument specifies a block or character file. #more Command: more - pager Syntax: more [flpsu] [-n] [+n] [+/pattern] [file] ... Flags: -d Display prompt message at each pause -f Do not fold lines -l Do not treat CTRL-L as form feed -p Page mode. Do not scroll -s Suppress multiple blank lines -u Use escape sequences for underlining Examples: _M_o_r_e is a pager that allows one to examine files. This program was origi- nally produced at the University of California, Berkeley. When _m_o_r_e starts up, it displays a screenful of information from the first file in its list, and then pauses integer telling how many of something. - Display next page - Display next line CTRL-B - Go backward half a screenful CTRL-D - Go forward half a screenful lines = - Print current line number . - Repeat previ- ous command ' - (single quote) Go back to start of last search :f - Display current file name and line number b - Go backward half a screenful d - Go forward half a screenful /_u_s_r/_l_i_b/_m_o_r_e._h_e_l_p lines lines For the benefit of users who always want to use certain flags when calling _m_o_r_e, the shell variable MORE can be set to the desired default flags, e.g. MORE="-p". #mount Command: mount - mount a file system Syntax: /etc/mount special file [-r] Flags: -r File system is mounted read-only Example: The file system contained on the special file is mounted on _f_i_l_e. In the 29 example above, the root directory of the file system in drive 1 can be accessed as /_u_s_e_r after the mount. When the file system is no longer needed, it must be unmounted before being removed from the drive. #mv Command: mv - move or rename a file Syntax: mv file1 file2 mv file ... directory Flags: (none) Examples: _M_v moves one or more files from one place in the file system to another. If the old path and new path are on the same device, it is done by linking and unlinking, otherwise by copying. #nm Command: nm - print name list Syntax: nm [-gnopru] [file] ... Flags: -g Print only external symbols -n Sort numerically rather than alphabeti- cally -o Prepend file name to each line rather than only once -p Don't sort, print in symbol-table order -r Sort in reverse order -u Print only undefined symbols Examples: _N_m prints the symbol table of executable files when it is available. If no file is given, the symbols in a.out are used. The format of the table is somewhat compatible with the one produced by _a_s_l_d when used with the -s option. The symbol table can be added with _a_s_t. Archives are not supported. Note that assembly language files don't have symbol tables. #od Command: od - octal dump Syntax: od [-bcdhox] [file] [ [+] offset [.][b] ] Flags: -b Dump bytes in octal -c Dump bytes as ASCII characters -d Dump words in decimal -h Print addresses in hex (default is octal) -o Dump words in octal (default) -x Dump words in hex 30 Examples: _O_d dumps a file in one or more formats. If _f_i_l_e is missing, standard input is dumped. The _o_f_f_s_e_t argument tells _o_d to skip a certain number of bytes or blocks before starting. The offset is in octal bytes, unless it is followed by a ``.'' for decimal or b for blocks or both. #passwd Command: passwd - change a login password Syntax: passwd [name] Flags: (none) Examples: _P_a_s_s_w_d is used to change your password. It prompts for the old and new pass- words. It asks for the new password twice, to reduce the effect of a typing error. Do not forget to copy the modified password file back to the root file system diskette, or the changes will be lost when the system is rebooted. #paste Command: paste - paste multiple files together Syntax: paste [-s] [-ddelim] file ... Flags: -s Print files sequentially, file k on line k -d delim Examples: _P_a_s_t_e displays multiple files in parallel. Suppose a set of k files each have one word per line. Then the _p_a_s_t_e output will have k columns, with the contents of file _j in column _j. The columns are separate by tabs unless the separator is changed with the -d flag. If the -s flag is given, then the first file is on line 1, the second file on line 2, etc. In effect, -s turns the files sideways. #patch Command: patch - patches up a file from the original and a diff Syntax: patch [-bcdDefFlnNop] Flags: -b Next argument is backup extension, instead of .orig -c Interpret the patch file as a context diff -d Cd to the next arg (assumed a dir) 31 before doing anything next arg gives label -e Interpret the patch file as an ed script -f Forces patch to do its work without ask- ing any questions -l Do matching loosely (e.g., all white space is equivalent) -n Interpret the patch file as a normal diff -N Ignore patches that are reversed or already applied -o Next argument is the output file name Example: _P_a_t_c_h takes an original file and a diff listing and recreates the new file. It is functionally similar to _f_i_x, but much more powerful. Not only can it han- dle normal diffs, but also context diffs produced by _c_d_i_f_f. In addition, it works even when the file being patched has other changes to it. It deduces the type of difflist itself (unless given -c, -e, or -n). The normal usage is given in the example above. In this case _p_a_t_c_h will modify 'file' to incorporate all the patches. The original file will be put on 'file . #pr Command: pr - print a file Syntax: pr [option] ... [-columns] [+page] [file] ... Flags: -h Take next argument as page header -l Sets page length in lines -n Number the output lines -t Do not print page header or trailer -w Sets line length in characters Examples: _P_r formats one or more files for printing. If no files are specified, stan- dard input is printed. Options are provided for setting the width and height of the page, the number of columns to use (default 1), and the page to start with, among others. #prep Command: prep - prepare a text file for statistical analysis Syntax: prep [file] Flags: (none) Example: 32 _P_r_e_p strips off most of the troff commands from a text file and then outputs all the words, one word per line, in the order they occur in the file. This file can then be sorted and compared to a dictionary (as a spelling checker), or used for statistical analyses. #printenv Command: printenv - print out the current environment Syntax: printenv Flags: (none) Example: _P_r_i_n_t_e_n_v prints out the current environment strings, one per line. #pwd Command: pwd - print working directory Syntax: pwd Flags: (none) Example: The full path name of the current working directory is printed. #rcp Command: rcp - remote copy Syntax: rcp [mach1]!file1 [mach2]!file2 Flags: (none) Examples: _R_c_p is not a program. It is a shell script that does remote copying. It makes use of the programs fIto and _f_r_o_m. #readall Command: readall - read a device quickly to check for bad blocks Syntax: readall file Flags: (none) Example: _R_e_a_d_a_l_l reads all of the named device in large chunks. It reports about blocks that it cannot read. Unlike _d_i_s_k_c_h_e_c_k, it does not attempt to write on the disk, making it "safer" to use when one is worried about a sick system. 33 #readclock Command: readclock - read the AT's real time clock Syntax: readclock Flags: (none) Example: _R_e_a_d_c_l_o_c_k reads the AT's real time clock and prints the result in a form use- ful to date, namely, MMDDYYhhmmss. If the clock does not exist (e.g., on a PC), it outputs "-q" to query the user for the time. The example given above can be put in /_e_t_c/_r_c to load the real time when the system is booted. #readfs Command: readfs - read a MINIX file system Syntax: readfs [-il] block_special [dir] Flags: -i Give information about the file, but do not extract files -l List the files extracted on standard output Example: _R_e_a_d_f_s reads a floppy disk containing a MINIX file system. It can extract all the files from it, give a listing of them, or both. The files extracted can be put in a user-specified directory (default: current directory). If subdirec- tories are needed, they will be created automatically. #rev Command: rev - reverse the characters on each line of a file Syntax: rev [file] ... Flags: (none) Example: Each file is copied to standard output with all the characters of each line reversed, last one first and first one last. #rm Command: rm - remove a file Syntax: rm [-fir] name ... Flags: -f Forced remove: no questions asked -i Interactive remove: ask before removing -r Remove directories too Examples: _R_m removes one or more files. If a file has no write permission, _r_m asks for permission (type ``y'' or ``n'') unless -f is specified. If the file is a 34 directory, it will be recursively descended and removed if and only if the -r flag is present. #rmdir Command: rmdir - remove a directory Syntax: rmdir directory ... Flags: (none) Examples: The specified directories are removed. Ordinary files are not removed. #roff Command: roff - text formatter Syntax: roff [-hs] [+n] [-n] file ... Flags: -h Expand tabs to spaces in output -s Stop before each page; continue on DEL +_n Start printing with page _n _n Stop after page _n Examples: _R_o_f_f is a text formatter. Its input consists of the text to be output, intermixed with formatting commands. A formatting command is a line containing the control character followed by a two character command name, and possibly one or more arguments. The control character is initially ``.'' (dot). The format- ted output is produced on standard output. The formatting commands are listed below, with _n being a number, _c being a character, and _t being a title. A + before _n means it may be signed, indicating a positive or negative change from the current value. Initial values for _n, where relevant, are given in parentheses. .ad Adjust right margin. .ar Arabic page numbers. .br Line break. Subsequent text will begin on a new line. .bl n Insert _n blank lines. .bp +n Begin new page and number it _n. No _n means +1. .cc c Control character is set to _c. .ce n Center the next _n input lines. .de zz Define a macro called _z_z. A line with ``..'' ends definition. .ds Double space the output. Same as .ls 2. .ef t Even page footer title is set to _t. .eh t Even page header title is set to _t. .fi Begin filling output lines as full as possible. .fo t Footer titles (even and odd) are set to _t. .hc c The character _c (e.g., %) tells _r_o_f_f where hyphens are permitted. .he t Header titles (even and odd) are set to _t. 35 .hx Header titles are suppressed. .hy n Hyphenation is done if _n is 1, suppressed if it is 0. Default is 1. .ig Ignore input lines until a line beginning with ``..'' is found. .in n Indent _n spaces from the left margin; force line break. .ix n Same as ._i_n but continue filling output on current line. .li n Literal text on next _n lines. Copy to output unmodified. .ll +n Line length (including indent) is set to _n (65). .ls +n Line spacing: _n (1) is 1 for single spacing, 2 for double, etc. .m1 n Insert _n (2) blank lines between top of page and header. .m2 n Insert _n (2) blank lines between header and start of text. .m3 n Insert _n (1) blank lines between end of text and footer. .m4 n Insert _n (3) blank lines between footer and end of page. .na No adjustment of the right margin. .ne n Need _n lines. If fewer are left, go to next page. .nn +n The next _n output lines are not numbered. .n1 Number output lines in left margin starting at 1. .n2 n Number output lines starting at _n. If 0, stop numbering. .ni +n Indent line numbers by _n (0) spaces. .nf No more filling of lines. .nx f Switch input to file _f. .of t Odd page footer title is set to _t. .oh t Odd page header title is set to _t. .pa +n Page adjust by _n (1). Same as .bp .pl +n Paper length is _n (66) lines. .po +n Page offset. Each line is started with _n (0) spaces. .ro Page numbers are printed in Roman numerals. .sk n Skip _n pages (i.e., make them blank), starting with next one. .sp n Insert _n blank lines, except at top of page. .ss Single spacing. Equivalent to .ls 1. .ta Set tab stops, e.g., .ta 9 17 25 33 41 49 57 65 73 (default). .tc c Tabs are expanded into _c. Default is space. .ti n Indent next line _n spaces; then go back to previous indent. .tr ab Translate _a into _b on output. .ul n Underline the letters and numbers in the next _n lines. #rsh Command: rsh - remote shell for networking Syntax: rsh port [-beil] Flags: -b Start the rsh in the background -e Keep _s_t_d_e_r_r separate from _s_t_d_o_u_t -i Take input from the local process Examples: The remote shell command is the way to have a distant server carry out a com- mand over the Ethernet. The port given as the first argument can be any string of up to 6 characters, but it must match the port used by some sherver. The command will be executed and the results returned on _s_t_d_o_u_t. Unless the -e flag 36 is given, the remote _s_t_d_e_r_r and _s_t_d_o_u_t are merged onto the local _s_t_d_o_u_t. Giving _r_s_h with just a port and no argument is the standard way to log onto a remote machine. #sed Command: sed - stream editor Syntax: sed [-f script_file] [edit_script] [file] Flags: -f The following argument contains the edit script Examples: _S_e_d is a stream editor. It takes an edit script either from its argument or a file, and performs an edit session on a named file or _s_t_d_i_n, producing output on _s_t_d_o_u_t. #sh Command: sh - shell Syntax: sh [file] Flags: (none) Example: _S_h is the shell. It permits redirection of input and output, pipes, magic characters, background processes, shell scripts and most of the other features of the V7 (Bourne) shell. A few of the more common commands are listed below: date sort sort cc a.out sort sort (ls sort sort ls ls ls ls ls v=/usr/ast ls PS1='Hi! PS2='More: ls echo if 37 for while case echo echo echo echo echo #shar Command: shar - shell archiver Syntax: shar file ... Flags: (none) Examples: The named files are collected together into a shell archive written onto standard output. The individual files can be extracted by redirecting the shell archive into the shell. The advantage of _s_h_a_r over _a_r is that _s_h_a_r archives can be read on almost any UNIX system, whereas numerous, incompatible versions of _a_r are in widespread use. Extracting the files from a shell archive requires that _g_r_e_s is accessible. In the distribution, _g_r_e_s is in /_u_s_e_r/_b_i_n rather than /_u_s_r/_b_i_n. #sherver Command: sherver - shell server Syntax: sherver port Flags: (none) Example: The _r_s_h command does its remote execution by doing a remote procedure call to some sherver. The sherver executes the command and then exits. Usually a master will be running to make a new one. Because shervers get their input from a pipe, remote execution cannot handle signals and CTRL-D, because they cannot be sent down a pipe. #size Command: size - print text, data, and bss size of a program Syntax: size [file] ... Flags: (none) Example: The text, data, bss, and total sizes for each argument are printed. If no arguments are present, _a._o_u_t is assumed. The amount of memory available for combined stack and data segment growth is printed in the column ``stack.'' This 38 is the value manipulated by the _c_h_m_e_m command. The total amount of memory allo- cated to the program when it is loaded is listed under ``memory.'' This value is just the sum of the other four columns. #sleep Command: sleep - suspend execution for a given number of seconds Syntax: sleep seconds Flags: (none) Example: The caller is suspended for the indicated number of seconds. This command is typically used in shell scripts. #sort Command: sort - sort a file of ASCII lines Syntax: sort [-bcdfimnru] [-tx] [-o name] [+pos1] [-pos2] file ... Flags: -b Skip leading blanks when making com- parisons -c Check to see if a file is sorted -d Dictionary order: ignore punctuation -f Fold upper case onto lower case -i Ignore nonASCII characters -m Merge presorted files -n Numeric sort order -o Next argument is output file -r Reverse the sort order -t Following character is field separator -u Unique mode (delete duplicate lines) Examples: _S_o_r_t sorts one or more files. If no files are specified, standard input is sorted. Output is written on standard output, unless -o is specified. The options +_p_o_s_1 -_p_o_s_2 use only fields _p_o_s_1 up to but not including _p_o_s_2 as the sort key, where a field is a string of characters delimited by spaces and tabs, unless a different field delimiter is specified with -t. Both _p_o_s_1 and _p_o_s_2 have the form _m._n where _m tells the number of fields and _n tells the number of characters. Either _m or _n may be omitted. #spell Command: spell - print all words in a file not present in the dictionary Syntax: spell file Flags: (none) 39 Example: _S_p_e_l_l is the MINIX spelling checker. It is actually a short shell script. First, the program _p_r_e_p strips off the _r_o_f_f, _n_r_o_f_f, and _t_r_o_f_f control lines, and the punctuation, and lists each word on a separate line. These words are then sorted. The resulting output is then compared to the dictionary. Words present in the file but not present in the dictionary are listed. The dictionary should be located in /_u_s_r/_l_i_b (or the shell script changed). #split Command: split - split a large file into several smaller files Syntax: split [-n] [file [prefix]] Flags: -_n Number of lines per piece (default: 1000) Examples: _S_p_l_i_t reads _f_i_l_e and writes it out in _n-line pieces. By default, the pieces are called _x_a_a, _x_a_b, etc. The optional second argument can be used to provide an alternative prefix for the output file names. #strings Command: strings - print all the strings in a binary file Syntax: strings file ... Flags: - search whole file, not just data seg -o Print octal offset of each string -n N is minimum length string (def. = 4) Examples: _S_t_r_i_n_g_s looks for sequences of ASCII characters followed by a zero byte. These are usually strings. This program is typically used to help identify unk- nown binary programs #strip Command: strip - remove symbol table from executable file Syntax: strip [file] ... Flags: (none) Example: For each file argument, _s_t_r_i_p removes the symbol table. Strip makes a copy of the file being stripped, so links are lost. 40 #stty Command: stty - set terminal parameters Syntax: stty [option ...] Flags: (none) Examples: When given no arguments, _s_t_t_y prints the current terminal parameters. It can also be used to set the parameters, as follows: cbreak - Enter _c_b_r_e_a_k mode; erase and kill disabled echo - Echo input on the terminal nl - Accept only line feed to end lines raw - Enter _r_a_w mode; no input processing at all tabs - Output tabs (do not expand to spaces) erase c - Set erase character (initially backspace) int c - Set interrupt (SIGINT) character (initially DEL) kill c - Set kill line character (initially @) quit c - Set quit (SIGQUIT) character (initially CTRL-\) default - Set options back to original values The first five options may be prefixed by - as in -tabs to turn the option off. The next four options each have a single character parameter separated by a space from the option. The default option sets the mode and the four settable characters back to the values they had when the system was booted. It is useful when a rogue program has messed them up. #su Command: su - temporarily log in as super-user or another user Syntax: su [name] Flags: (none) Examples: _S_u can be used to temporarily login as another user. It prompts for the super-user password. If the correct password is entered, _s_u creates a shell with the desired uid. If no name is specified, _r_o_o_t is assumed. To exit the temporary shell, type CTRL-D. #sum Command: sum - compute the checksum and block count of a file Syntax: sum file Flags: (none) Examples: _S_u_m computes the checksum of one or more files. It is most often used to see if a file copied from another machine has been correctly received. This program works best when both machines use the same checksum algorithm. 41 #sync Command: sync - flush the cache to disk Syntax: sync Flags: (none) Example: MINIX maintains a cache of recently used disk blocks. The _s_y_n_c command writes any modified cache blocks back to the disk. This is essential before stopping the system, and should be done before running any _a._o_u_t program that might crash the system. #tail Command: tail - print the last few lines of a file Syntax: tail [-n] [file] ... Flags: -_n How many lines to print Examples: The last few lines of one or more files are printed. The default count is 10 lines. The default file is standard input. #tar Command: tar - tape archiver Syntax: tar [cxtv] tarfile file ... Flags: -c Create a new archive -t Print a table listing the archive's con- tents -v Verbose mode-tell what is going on as it happens -x The named files are extracted from the archive Examples: _T_a_r is an archiver in the style of the standard tape archiver, except that it does not use tape. It's primary advantage over _a_r is that the _t_a_r format is somewhat more standardized than the _a_r format, making it theoretically possible to transport MINIX files to another computer, but do not bet on it. If the tar- get machine runs MS-DOS, try _d_o_s_w_r_i_t_e. #tee Command: tee - divert standard input to a file Syntax: tee [-ai] file ... Flags: -a Append to the files, rather than overwriting 42 -i Ignore interrupts Examples: _T_e_e copies standard input to standard output. It also makes copies on all the files listed as arguments. #term Command: term - turn PC into a dumb terminal Syntax: term [baudrate] [parity] [bits_per_character] Flags: (none) Examples: _T_e_r_m allows MINIX to talk to a terminal or modem over RS232 port 1. The pro- gram first sets the baudrate, parity and character length, and then forks. The parent sits in a loop copying from standard input (usually the console's key- board), to the terminal or modem (/dev/tty1). The child sits in a loop copying from the terminal or modem (/dev/tty1) to standard output. Thus when RS232 port 1 is connected to a modem, every keystroke typed on the keyboard is sent to the modem, and every character arriving from the modem is displayed. Standard input and output may be redirected, to provide a primitive file transfer program, with no checking. To exit _t_e_r_m, hit the middle button on the numeric pad. Important note: to use _t_e_r_m, it is essential that /_e_t_c/_t_t_y_s is configured so that there is no shell hanging on /_d_e_v/_t_t_y_1. If there is, both the shell and term will try to read from /_d_e_v/_t_t_y_1, and nothing will work. #termcap Command: termcap - print the current termcap entry Syntax: termcap [type] Flags: (none) Example: _T_e_r_m_c_a_p reads the /etc/termcap entry corresponding to the terminal type sup- plied as the argument. If none is given, the current $TERM is used. It then prints out all the parameters that apply. #test Command: test - test for a condition" Syntax: test expr Flags: (none) Example: _T_e_s_t checks to see if files exist, are readable, etc. and returns an exit 43 status of zero if true and nonzero if false. The legal operators are -r file true if the file is readable -w file true if the file is writable -x file true if the file is executable -f file true if the file is not a directory -d file true if the file is a directory -s file true if the file exists and has a size > 0 -t fd true if file descriptor fd (default 1) is a terminal -z s true if the string s has zero length -n s true if the string s has nonzero length s1 = s2 true if the strings s1 and s2 are identical s1 != s2 true if the strings s1 and s2 are different m -eq m true if the integers m and n are numerically equal The operators -gt, -ge, -ne, -le, -lt may be used as well These operands may be combined with -a (Boolean and), -o (Boolean or), ! (negation). The priority of -a is higher than that of -o. Parentheses are permitted, but must be escaped to keep the shell from trying to interpret them. #time Command: time - report how long a command takes Syntax: time command Flags: (none) Examples: The command is executed and the real time, user time, and system time (in seconds) are printed. #to Command: to - output half of a connection Syntax: to port Flags: (none) Example: _T_o and _f_r_o_m are used together to provide connection-oriented service. On the sending machine, the last member of a pipeline is 'to port'. On the receiving machine, the first member of a pipe line is 'from port'. The net result is that the output of the sending pipeline goes into the input of the receiving pipe- line, making pipelines work across the network. As a simple example, consider: on machine1: cat f1 f2 | to Johnny on machine2: from Johnny | sort >x The effect of these two commands is that the files f1 and f2 are con- catenated, transferred to machine 2, and sorted their, with the output going to a file _x on machine 2. The string _J_o_h_n_n_y is used by the transaction system to identify which sender goes with which receiver; any unique string can be used. #touch 44 Command: touch - update a file's time of last modification touch [-c] file ... Flags: -c Do not create the file Example: The time of last modification is set to the current time. This command is mostly used to trick _m_a_k_e into thinking that a file is more recent than it really is. If the file being touched does not exist, it is created, unless the -c flag is present. #tr Command: tr - translate character codes Syntax: tr [-cds] [string1] [string2] Flags: -c Complement the set of characters in _s_t_r_i_n_g_1 -d Delete all characters specified in _s_t_r_i_n_g_1 -s Squeeze all runs of characters in _s_t_r_i_n_g_1 to one character Examples: _T_r performs simple character translation. When no flag is specified, each character in _s_t_r_i_n_g_1 is mapped onto the corresponding character in _s_t_r_i_n_g_2. #traverse Command: traverse - print directory tree under the named directory Syntax: traverse dir Flags: (none) Example: _T_r_a_v_e_r_s_e prints the tree structure starting at the named directory. All the subdirectories are listed, with the depth shown by indentation. #treecmp Command: treecmp - recursively list differences in two directory trees Syntax: treecmp [-v] dir1 dir2 Flags: -v (verbose) list all directories processed Example: _T_r_e_e_c_m_p recursively descends the directory tree of its first argument and compares all files to those at the corresponding position in the second argu- ment. If the two trees are identical, i.e., all the corresponding directories and files are the same, there is no output. Otherwise, a list of files missing from one of the trees or present in both but whose contents are not identical in 45 both are printed. #true Command: true - exit with the value true Syntax: true Flags: (none) Example: do ls -l done This command returns the value _t_r_u_e. It is used for shell programming. #tset Command: tset - set the $TERM variable Syntax: tset [device] Flags: (none) Example: _T_s_e_t is used almost exclusively to set the shell variable TERM from inside profiles. If an argument is supplied, that is used as the value of TERM. Oth- erwise it looks in /_e_t_c/_t_t_y_t_y_p_e. #tsort Command: tsort - topological sort Syntax: tsort file Flags: (none) Example: _T_s_o_r_t accepts a file of lines containing ordered pairs and builds a total ordering from the partial orderings. #ttt Command: ttt - tic tac toe Syntax: ttt Flags: (none) Example: This program allows the user to engage in a game of tic tac toe (noughts and crosses) with the computer. The program uses the alpha-beta algorithm, so the user had better be sharp. 46 #tty Command: tty - print the device name of this tty Syntax: tty Flags: -s Silent mode (return status only) Example: Print the name of the controlling tty #umount Command: umount - unmount a mounted file system Syntax: /etc/umount special Flags: (none) Example: A mounted file system is unmounted after the cache has been flushed to disk. A floppy disk should never be removed while it is mounted. If this happens, and is discovered before another floppy disk is inserted, the original one can be replaced without harm. Attempts to unmount a file system holding working direc- tories or open files will be rejected with a ``device busy'' message. #uniq Command: uniq - delete consecutive identical lines in a file Syntax: uniq [-cdu] [+n] [-n] [input [output]] Flags: -c Give count of identical lines in the input -d Only duplicate lines are written to out- put -u Only unique lines are written to output Examples: _U_n_i_q examines a file for consecutive lines that are identical. All but duplicate entries are deleted, and the file is written to output. The +_n option skips the first _n fields, where a field is defined as a run of characters separated by white space. The -_n option skips the first _n spaces. Fields are skipped first. #update Command: update - periodically write the buffer cache to disk Syntax: /etc/update Flags: (none) Example: When the system is booted, _u_p_d_a_t_e is started up in the background from /_e_t_c/_r_c to issue a SYNC system call every 30 sec. 47 #users Command: users - list the logged-in users Syntax: users Flags: (none) Example: _U_s_e_r_s prints a single line of text containing the names of all the currently logged-in users. #uudecode Command: uudecode - decode a binary file encoded with uuencode Syntax: uudecode file Flags: (none) Example: _U_u_d_e_c_o_d_e takes an input file, typically a uuencoded binary file, and con- verts it back to the original file. The decoded file is given the name that the original file had. The name information is part of the encoded file. #uuencode Command: uuencode - encode a binary file to ASCII (e.g., for mailing) Syntax: uuencode [input] output Flags: (none) Example: _U_u_e_n_c_o_d_e takes an input file, typically a binary file, and converts it to pure ASCII by encoding 3 bytes (24 bits) as 4 bytes in ASCII. Only 64 different characters are used, all of them valid ASCII characters. #vol Command: vol - split standard input into diskette-sized volumes Syntax: vol [-u] size block-special Flags: -u Unsave from diskettes Examples: It occasionally happens that a program generates an output stream intended for diskette but the stream is to large to fit on one diskette. _V_o_l is a pro- gram that accepts such a stream, and pauses every n blocks to request a new diskette to be inserted. This makes it possible to save arbitrarily long streams on a series of diskettes, as shown in the examples above. #wc 48 Command: wc - count characters, words, and lines in a file wc [-clw] file ... Flags: -c Print character count -l Print line count -w Print word count Examples: _W_c reads each argument and computes the number of characters, words and lines it contains. A word is delimited by white space (space, tab, or line feed). If no flags are present, all three counts are printed. #whereis Command: whereis - examine system directories for a given file Syntax: whereis file Flags: (none) Example: _W_h_e_r_e_i_s searches a fixed set of system directories, /_b_i_n, /_l_i_b, /_u_s_r/_b_i_n, and others, and prints all occurrences of the argument name in any of them. #which Command: which - examine $PATH to see which file will be executed Syntax: which name Flags: (none) Example: The $PATH shell variable controls the MINIX search rules. If a command a.out is given, the shell first tries to find an executable file in the working direc- tory. If that fails, it looks in various system directories, such as /_b_i_n and /_u_s_r/_b_i_n. The which command makes the same search and gives the absolute path of the program that will be chosen. #who Command: who - print list of currently logged in users Syntax: who Flags: (none) Example: _W_h_o prints a list of currently logged in users. For each one, the user name, terminal, and login time is printed. This program gets its information from the file /_u_s_r/_a_d_m/_w_t_m_p, which is updated by init and login. If the file does not exist, neither of these will create it, and _w_h_o will not work. Note that if you decide to create an empty /_u_s_r/_a_d_m/_w_t_m_p to enable the login accounting, it will grow forever and eventually fill up your disk unless you manually truncate it 49 from time to time. #whoami Command: whoami - print current user name Syntax: whoami Flags: (none) Example: In case you forget who you are logged in as, whoami will tell you. If you use _s_u to become somebody else, _w_h_o_a_m_i will give the current effective user. #write Command: write - write a message to a terminal Syntax: write ttyn Flags: (none) Example: Write _i_s _a _s_h_e_l_l _s_c_r_i_p_t _t_h_a_t _i_s _u_s_e_d _t_o _s_e_n_d _a _m_e_s_s_a_g_e _t_o _a_n_o_t_h_e_r _l_o_g_g_e_d _i_n _u_s_e_r _o_n _t_h_e _s_y_s_t_e_m. _T_h_e _u_s_e_r _i_s _i_d_e_n_t_i_f_i_e_d _b_y _t_t_y _n_u_m_b_e_r. _A_f_t_e_r _t_h_e _m_e_s_s_a_g_e _h_a_s _b_e_e_n _t_y_p_e_d, _t_h_e _u_s_e_r _t_y_p_e_s _C_T_R_L-_D _t_o _e_x_i_t.