%%% -*- Mode:TeX -*- \input ../Macros/6004.tex \input ../Macros/LabMacros \def\<#1>{\leavevmode\hbox{$\langle$#1\/$\rangle$}} \Handout{Laboratory Computer System}{9/13/91} \TwoPageMode{} {\bf UNIX rudiments} In the following, {\tt teletype} print indicates computer output; {\it italic} text is typed by you. Words in angle brackets, e.g., \, designate special keys (viz. the ENTER or carriage-return key). Control characters are typed by holding the \ key while pressing some other key and are denoted in the text as C-X (for \-X). Optional arguments appear in square brackets, e.g., [this\_is\_an\_optional\_arg]. \goodbreak{\bf Logging in} UNIX announces that a machine is available for use by displaying a version ID (like BSD 4.3) in an appropriate font and by prompting with the message \quad{\tt login:} Note that the backspace key is interpreted as a literal character, so if you make a mistake while typing the login name, you cannot correct with the backspace key, but must wait for a new login prompt and try again. When successful, this will ``log you in'' to the system, establishing you as the current user. \goodbreak {\bf UNIX Commands} System commands occupy a single line of text, and consist of one or more ``words'' (not necessarily English words!) separated by blanks. The first word of a command line denotes the action to be taken. It is, in fact, the name of a program which is to be executed. Remaining words indicate arguments or options to the command. They are often names of files. Examples of a few basic UNIX commands are presented here. A more complete summary appears in Appendix I. %%% \vfill\eject \Example{ll} Lists your files on the file system. \Example{more filename1 [filename2] [filename3] ...} Displays the contents of the specified file system files on the CRT. Each {\it filename} is presumed to contain text. \Example{del filename1 [filename2] [filename3] ...} Deletes the named files from the file system. Once the files have been deleted, they may be ``undeleted'' by typing: \Example{undel filename1 [filename2] [filename3] ...} Note that this differs from the normal UNIX command {\it rm} which ``removes'' a file {\bf permanently}. You therefore probably never want to use the {\it rm} command. All deleted files are permanently expunged when you log out. \Example{logout} Logs you off of the system, making it available for use by somebody else. Thus, {\it logout} is the last command you type in a session. Note that you will automatically be logged off the system if you are inactive for more than six hours, so don't leave your machine at night and expect to still be logged in the next morning. See Appendix I for a more extensive list of useful commands. \vfill\eject {\rm Appendix I -- UNIX Summary} {\bf Keyboard:} \beginlist{1.1in} \listitem{C-C} is the QUIT character; it will usually abort the current command and return you to UNIX command level. \listitem{C-U} is the KILL character, and will erase the partial line you have typed. \listitem{\} will erase the last character you typed. \endlist {\bf During session:} \global\advance\leftskip by .5in \global\advance\rightskip by .5in \Example{ll} to list your files on the file system. \Example{more filename1 [filename2] ...} to display the files on the console. \Example{del filename1 [filename2] ...} to DELete the named files (they will not permanently go away until you logout). \Example{undel filename1 [filename2] ...} to UNDELete the named files. \Example{rm filename1 [filename2] ...} to ReMove the named files PERMANENTLY. \Example{cp filename1 filename2} to CoPy the contents of \it filename1 \rm to \it filename2 \rm. \Example{mv filename1 filename2} to MoVe (rename) file \it filename1 \rm to be called \it filename2 \rm. \Example{emacs} to enter the editor to create a new text file or use the tutorial; or \Example{emacs filename} to edit (revise) the contents of the file \it filename \rm \global\advance\leftskip by -.5in \global\advance\rightskip by -.5in \goodbreak {\bf Ending session:} \global\advance\leftskip by .5in \global\advance\rightskip by .5in \Example{logout} to sign off the machine. \global\advance\leftskip by -.5in \global\advance\rightskip by -.5in \vfill\eject \begintt Appendix II -- Summary of Emacs commands C-A moves to the beginning of the line C-B moves back one character C-D deletes forward one character C-E moves to the end of the line C-F moves forward one character C-G quits from any command in progress C-H (or ) deletes character to left C-K Kills to end of line (with argument, kills multiple lines) C-L refreshes the screen C-M Opens a new line and moves to the beginning of it. C-N moves down one line C-O opens up a new line C-P moves up one line C-Q quotes the next character C-R starts a reverse search (end by typing ) C-S starts a search (end by typing ) C-T transposes current and previous characters C-U Multiplies the argument by 4; numeric argument may be entered. C-V moves to the next screenful C-W kills the current region (between cursor and mark) C-X is a prefix for more single character commands C-Y restores last killed text (leaves cursor and mark around it) C-Z enters UNIX subprocess (use ^D to get back to Emacs) Makes the next character a meta character; numeric arguments may be entered. M-@ sets the mark at the cursor position M-% starts query replace M-< moves to top of file M-> moves to bottom of file M-V moves back one screenful \endtt \begintt C-X C-B List all buffers and their characteristics. C-X C-C Exits Emacs C-X C-F Edits a file in its own buffer (if file has been read into a buffer, moves to it) C-X C-O Switches between windows C-X C-R Reads a new file; with argument, inserts a file. C-X C-S saves the buffer in the current file (if modified) C-X C-W writes a new or old file C-X C-X exchanges the mark and the cursor C-X 1 Exits two window mode C-X 2 Enters two window mode C-X B Changes Buffers DEL-B prints all the current keys and their associated functions. DEL-K prints documentation on the key's function. DEL-T run the tutorial (reads the tutorial file) \endtt \end