Viewing files with cat, more, less, head, and tail

READ ALL ABOUT IT!

Article from Issue 64/2006
Author(s):

Practical tools such as cat, less, and head are convenient for viewing text.

You don’t always need to launch an editor to view text files at the console. More often than not, a simple viewer is far quicker. But the programs we will be looking at in this month’s issue have a lot more tricks up their sleeves. If you are looking for a fast approach to concatenating multiple files in a single file, cat is the tool you need. This article also looks at tips for the more and less pagers, showing you more convenient approaches to using these tools. And if you are just interested in grabbing the first or last few lines of a file, head and tail are the tools you need. Catwalk

cat lets you output a text file via standard output:

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: Viewing Files

    If you just want to peek into a text file, Linux has an abundance of commands to satisfy your curiosity.

  • Command Line: Archives

    Gzip and bzip2 not only compress files, they also provide lean and powerful tools for viewing, searching, and comparing text files.

  • Command Line: File Management

    Once you’ve mastered the everyday commands for manipulating files, you might want to do more. We show you some powerful commands for advanced file management.

  • Command Line: Diffutils

    The Diffutils tool set helps you compare text files, discover and display the differences between files, and even automatically synchronize files.

  • Command Line: FTP and NcFTP

    FTP and NcFTP are both FTP clients for the command line. While FTP only has basic file transfer functionality, NcFTP has a whole bunch of additional features.

comments powered by Disqus

Direct Download

Read full article as PDF:

Command_Line_File_Viewers.pdf (39.46 kB)

News