Developer's Daily Unix by Example
  main | java | perl | unix | DevDirectory
   
Main
Unix
Education
Unix by Example
   

 

Command cat
Description The "cat" command lets you view text files. "cat" is short for concatenate.
Examples cat /etc/passwd

This command displays the "/etc/passwd" file on your screen.

cat /etc/profile

This command displays the "/etc/profile" file on your screen. Notice that some of the contents of this file may scroll off of your screen.

cat file1 file2 file3 > file4

This command combines the contents of the first three files into the fourth file.

 

The drawback of the "cat"command (when displaying file contents to your screen) is that the contents of the file may scroll off of the screen. In cases where a file is to large to fit on the screen, you're better off using the "more" command to display the file. In fact, it's probably easier to use the more command all the time, and just use the cat command to concatenate (merge) files.


What's related

copyright 1998-2007, devdaily.com, all rights reserved.
devdaily.com, an alvin j. alexander production.