Command Line Basics: View Files With cat

Oakley the CatThere are many ways to view files in GNU/Linux. One of the simplest command line tools for viewing files is cat. The cat command, short for concatenate, is actually intended for joining multiple files into one, but it works equally well for viewing text files.

The command is easy to use. Just enter cat filename. For example, information about your computer’s cpu is stored in /proc/cpuinfo, so if you want to view this file, just enter

cat /proc/cpuinfo

If you’d like to view the file with line numbers, enter

cat -n /proc/cpuinfo

Like I said, there are more ways to view text files from the command line which I’ll cover in the future.

3 thoughts on “Command Line Basics: View Files With cat

  1. Chris

    A variant of cat that I picked up recently and can be handy – it turns your cat around and has her face tail first. Try this example:
    tac /proc/cpuinfo

    Reply
  2. Pingback: fsdaily.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.