All the commands mentioned here are covered in more detail in Chapter 5 and Chapter 6, "Editing and Printing Files"; we covered nano in Chapter 2.
The less , cat , head , and tail commands (described below) are all used for viewing files. For more detailed information on these four commands, see Chapter 5.
less The less command is a pager a utility for viewing a long stream of text one screen (or page ) at a time. When you are viewing a Unix man page, you are seeing it paged through less .
cat The cat command is used to combine ( concatenate ) files together. It is frequently used to simply display an entire file without pausing.
You can think of cat as a way of displaying short files, and less for displaying long files.
head The head command is used to show just the beginning of a file or other output.
tail If head shows the beginning, can you guess what tail does?
The three most common Unix tools for editing text files are vi , emacs , and nano . We'll cover these in more detail in Chapter 6.
vi vi is a full-featured command-line text editor. It is found on virtually every Unix system and is the primary editing tool we cover in this book.
emacs emacs is another full-featured text editor and has far more features than vi (including a built-in adventure game). Many programmers prefer emacs to vi , and the debate over which editor is best sometimes seems religious rather than rational.
nano This is a fairly simple text editor. It is intended to work like another simple editor called pico (the Pine Composer), and in versions of Mac OS X prior to 10.4 pico was supplied instead of nano . nano has a less restrictive license than pico .