[Chapter 25] Showing What's in a File
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:43:05Z

#

| Chapter 25 |

# 25. Showing What's in a File

Contents:
Cracking the Nut
Four Ways to Skin a cat
Using more to Page Through Files
The "less" Pager: More than "more"
Page Through Compressed, RCS, Unprintable Files
What's in That White Space?
Show Non-Printing Characters with cat -v or od -c
Finding File Types
Adding and Deleting White Space
Squash Extra Blank Lines
crush: A cat that Skips all Blank Lines
Double Space, Triple Space ...
pushin: Squeeze Out Extra White Space
How to Look at the End of a File: tail
Finer Control on tail
How to Look at a File as It Grows
An Alias in Case You Don't Have tail
Watching Several Files Grow
Reverse Lines in Long Files with flip
Printing the Top of a File
Numbering Lines

## 25.1 Cracking the Nut

This chapter talks about the many ways of dumping a file to the screen. Most users know the brute force approach provided by cat (25.2), but there's more to it than that:

- Pagers like more (25.3) and less (25.4) that give you more control when looking through long files.

- Looking at files that are compressed or otherwise unviewable (article 25.5).

- Finding out what type of data a file contains before opening it (article 25.8).

- Adding and deleting blank lines or other white space before displaying a file (articles 25.9 through 25.13).

- Looking at just the beginning or just the end of a file (articles 25.14 through 25.20).

- Numbering lines (article 25.21).

- TOR

IV. Looking Inside Files |  | 25.2 Four Ways to Skin a cat