O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

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

Introduction

There are a variety of ways to get the contents of a file on screen. Most people seem to agree that less is the most versatile paginator; consequently, you rarely see the others these days. Also included here are a few of the more specialized text display programs (e.g., tac, rev) that come in handy from time to time.

The commands covered in this section are designed to display the contents of an ASCII file, in whole or in part, to the screen. They include

cat Send contents of a file to standard output.
head Display the top of a file to standard output.
less Display a file, with scrolling.
look Display lines that begin with a given string.
rev Display lines from last character to first.
tac Display lines in reverse order.
tail

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