Jetty web server - 248 CHAPTER 15 WORKING WITH TEXT FILES

248 CHAPTER 15 WORKING WITH TEXT FILES Figure 15-4. Use vi s Command-Line mode to issue commands. For a list of basic Command-Line mode commands, see Table 15-2. Table 15-2. Some vi Command-Line Mode Commands Command Description :w Save the file :w! Save the file and ignore errors such as an existing file with the same filename :q Quit vi :q! Quit vi and ignore errors such as an unsaved file :s/word/replacement/ Search from the cursor downwards and replace any instances of the word with the replacement 1 :help View help documentation 1 The search tool is very powerful and uses a number of command options for additional flexibility. Read the vi help file to learn more. Using vi to Edit a File As an example, let s use vi to edit the OpenOffice.org README file. You don t want to actually alter this file, so start by making a copy of it in your home directory: cp /usr/lib/openoffice2/README ~ This will copy the file README01 to your /home directory, which you indicate using the ~ symbol.

Leave a Reply