O'Reilly logo

Learning the UNIX Operating System, Fourth Edition by Jerry Peek, John Strang, Grace Todino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. File Management

Methods of Creating Files

You’ll usually create a text file with a text editor. An editor lets you add, change, and rearrange text easily. Two common UNIX editors are vi (pronounced “vee-eye”) and emacs (“ee-macs”).

Neither of those editors has the same features as popular word processing software on personal computers. Instead of being designed for making documents, envelopes, and so on, vi and emacs are very sophisticated, extremely flexible editors for all kinds of text files: programs, email messages, and so on. Many UNIX systems also support easy-to-use word processors. Ask your system administrator what’s available. Pico is a simple editor (not word processor) that has been added to many UNIX systems.

Since there are several editor programs, you can choose one you’re comfortable with. vi is probably the best choice because almost all UNIX systems have it, but emacs is also widely available. The O’Reilly & Associates books Learning the vi Editor and Learning GNU Emacs cover those editors in detail. If you’ll be doing only simple editing, however, pico is a great choice. Although pico is much less powerful than emacs or vi, it’s also a lot easier to learn.

You can also create a file by using a UNIX feature called input/output redirection, as Chapter 5, explains. This sends the output of a command directly to a file—to make a new file or make an existing file larger.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required