Chapter 12. Working with Text Files


  • Using popular editors for UNIX-like systems

  • Using vi

  • Using Emacs

  • Using the graphical gedit editor

  • Using other editors for Linux systems

Most of us are used to working with files in various application-specific formats, often identified by their file extension or a special icon on our graphical desktops. We're all familiar with the doc files produced by graphical word processors such as Microsoft Word, xls files produced by spreadsheets such as Excel, fm files produced by FrameMaker, ppt files produced by PowerPoint, and so on. All of these files contain application data in a specific, often binary, format that lets the associated application make the best possible use of these files, but which often makes them hard to use with any application other than the one that created them.

At the other end of the spectrum from these application-specific files is the lowest-common-denominator file format known as text files or, to be a bit more specific, ASCII text files. The contents of these files consist of only the standard letters, numbers, punctuation, and symbols that you find on a computer keyboard. The nice thing about these types of files is that they are easy to read, easy to process, and easy to work with in general.

Regardless of what you use your Ubuntu Linux system for, you will almost certainly end up editing a text file one of these days. If you write code, it is almost certainly in standard text files because they provide a lowest-common-denominator ...

Get Ubuntu® Linux® Bible: Featuring Ubuntu 10.04 LTS, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.