12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Editing Text Files 115A text version is also available for use at the command line as shown in Figure 4.8.4FIGURE 4.8The Text-Based Version of the Emacs EditorThe emacs RPM package must be installed to use this editor. If it is not installed, install itas described in Chapter 3. To begin, type the emacs command. Just like Vi, the emacscommand can optionally be followed by a space and a filename. If the file exists, it will beopened in the editor. If it doesn’t exist, it will be created the first time the file is saved.To force the editor to start in text-based mode, execute the emacs -nw command for “nowindow.”Most Emacs commands are key combinations. After typing the contents of the file, pressCtrl+X, Ctrl+S to save the file. Press Ctrl+X, Ctrl+C to quit Emacs. To open a file, use theCtrl+X, Ctrl+F key combo, enter the filename at the prompt at the bottom of the editor, andpress Enter. If a file is already open in the editor, the new file will be opened at the same time.To switch between open files, use the Ctrl+X, B key combo. Either press Enter to switch to the“buffer” listed at the bottom of the editor or press Tab to see a list of available open files.Common Emacs operations are provided in Table 4.3. For even more instructions on usingthe editor, pick up an inexpensive book on the editor or read some of the numerous tutorialson the Web.TABLE 4.3 Common Emacs CommandsCommandDescriptionCtrl+X, Ctrl+SSave the fileCtrl+X, Ctrl+WSave the file with a different filenameCtrl+X, Ctrl+CExit EmacsCtrl+X, Ctrl+FOpen a fileCtrl+X, bSwitch buffersCtrl+AMove cursor to beginning of the lineCtrl+EMove cursor to end of the line

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!