. Mail files are simply text files, with a format that the mail program understands. You can process them with any of the standard UNIX utilities like grep , and read them with editors or paginators .
. You can quit reading the current mailbox file and switch to reading another one with the command: folder filename . For example folder +usability . reads in the mail messages in the file usability which is in the folder directory . Other filenames are: % your system mailbox # the previous mail file that you were reading your personal mbox file .
. The following topics are related to your present task. Select an item for more information about it. Online manual pages are displayed using another program known as "pager". Find out which pager you are using . Using a different pager .
. You can use a command by giving the full pathname to it. For example: ~amy/project/beta/bin/minder . This will run the command minder which is located in the directory project/beta/bin in the home directory of the user amy . The ~ (tilde) character is used as shorthand for the path to the user's home directory .
You can mail binary files between Unix systems that have the tarmail or uuencode utilities installed. ... The tarmail command converts the binary file into a text file and then compresses it to reduce its size. ... For example: tarmail joe@psy.gla.ac.uk "prog i promised u" a.out . This sends the file a.out to the person whose mail address is joe@psy.gla.ac.uk The quoted text is used as information for the Subject: field. tarmail can be used to send several files in the same mail message. ...
. To display the current effective username by which you are known to the system use the command: whoami . This is a useful command if you have several accounts on a system and switch between them using the su command.
For vi , a line is the string of characters between two <RETURN> characters. Although vi will automatically wrap the text onto a new line when it reaches the right-hand side of the screen, it does not insert a <RETURN> character. ... Adding a <RETURN> at the end of every line ensures that the appearance of the text on your screen corresponds to vi 's understanding of how text is structured. Setting the wrapmargin option automatically inserts a <RETURN> character whenever vi wraps text. ...
. Set an option and avoid having to insert a carriage return at the end of every line. Set the wrapmargin (wm) option to a value greater than 0 (zero). For example: set wm=5 . In insert mode, text is wrapped five (5) characters from the right margin of the screen and a <RETURN> character is automatically inserted.
. Suppose the system fails while you are editing a file! You can recover the file when you next log on to the system again by using the -r option to the vi command. For example: vi -r help.xdh . This restores the vi buffer for the file help.xdh to exactly the state it was in immediately before the system failed. You can continue to edit the file or write the contents of the buffer to the file.
. You can have several vi environments, each of which is different from the other. For example you might want a vi environment for writing C code and another for writing troff source files. This is done by placing a different .exrc file in each directory that you use vi in. Each .exrc file contains set option commands to create the type of vi environment you want while editing files in this directory.
. The following topics are related to your present task. Select an item for more information about it. Entering carriage returns . Setting a wrap margin .
. While using UNIX you will often want to create a text file and then change its content in some way. A text editor is a program that has been designed especially for this purpose. What is a text editor? . What is a file? . Using the vi editor . Using the MicroEMACS editor . MicroEMACS Quick Reference .
. A file is a collection of letters, numbers and special characters: it may be a program, a database, a dissertation, a reading list, a simple letter etc. Sometimes you may import a file from elsewhere, for example from another computer. If you want to enter your own text or data, you will start by creating a file. Whether you copied a file from elsewhere or created your own, you will need to return to it later in order to edit its contents.
. A text editor is a program for inserting or amending text in a file. A text editor is not a word processor although some text editors do include word processing facilities.
. To start using the 'toolkit' of editing instructions known collectively as MicroEMACS enter the command: ue . You are then placed 'in' MicroEMACS and use instructions that enable you to add, delete and manipulate text in the file. Using MicroEMACS commands .
You can type MicroEMACS instructions in upper or lower case. There are two types of instruction, CONTROL and META. These are typed while holding down the CTRL key which is signified by the ^ character. ... These are typed after pressing the ESC key which is signified by M-. ... Remember, the CONTROL instructions are typed with the CTRL key and the META instructions are typed after the ESC key. Sometimes a META or CONTROL instruction will prompt you for more information. ...
. You can leave text in its present location and move a copy of it to a different location. This is useful when you have a special paragraph that you want to repeat in a number of locations. To copy a block of text: . 1. Define the 'region' . 2. Type the M-C instruction to 'copy' the 'region'. 3. Move the cursor to the place where you want the copied text to go. 4. Type ^Y to 'yank' the text. A copy of the text moves from the 'kill' buffer and appears at its new location.