How is the command “$cat file2 “ different from “$cat >file2

Both the commands mean the same , the file file1 is read and its contents are copied to file2

Showing Answers 1 - 4 of 4 Answers

jagannathreddy

  • Feb 24th, 2006
 

The Commond  $cat file in unix is used to display the content of the file and where as commond $cat >> file is to append the text to the end of the file without overwritting the information of the file. Incase if the file does not exist in the directory the commond will create a newfile in file system.

Thanks

Jagannath

  Was this answer useful?  Yes

kcube

  • Nov 12th, 2006
 

$cat file2 --- Shows the contents of the file file2$cat >file2 --- Since there is no input file specified, it takes the standard input and copies it to a new file named file2. If the file2 is already existing, it will over write the file.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions