Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » CommandsRSS Feeds

Concatenate, copy, print files - cat

Posted By: Ben Evans     Category: Unix / Linux / Ubuntu     Views: 5390

This article explains about cat command with an example in unix.

cat command is used to concatenate, copy, print files in unix.

• Cat reads each file in a sequence and writes it on the standard output.
• Thus cat file prints file on the default standard output device.

Syntax of cat Command

cat [-options] fileName


Most Commonly used options are:
  • -e $ is printed at the end of each line. This option must be used with -v.
  • -s Suppress messages pertaining to files that do not exist.
  • -t Each tab will display as ^I and each form feed will display as ^L. This option must be used with -v.
  • -u Output is printed as unbuffered.
  • -v Display control characters and nonprinting characters.

Example of cat Command

cat file1 file2 > file3

Above example concatenates file1 and file2, and place the result in the file3.
  
Share: 


Didn't find what you were looking for? Find more on Concatenate, copy, print files - cat Or get search suggestion and latest updates.

Ben Evans
Ben Evans author of Concatenate, copy, print files - cat is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!