What is the difference between > and >> redirection operators ?

Is the output redirection operator when used it overwrites while >> operator appends into the file.

Showing Answers 1 - 13 of 13 Answers

Sagar

  • Mar 8th, 2006
 

'>' - redirects the O/P to file by creating it and if the file already exists it takes the liberty to overwrite it without user intimation

'>>' - redirects the output to a file by creating it and if the file already exists, it is appended

Chiranjeevi Manne

  • Mar 30th, 2007
 

">" operator redirects the output to a file, if the file already existst and contains some data in it, the ">" would cause the data over written with new data.

">>" Redirects the output to be appened to the end of the file instead of over writing it.

  Was this answer useful?  Yes

wow_suraj

  • Jun 17th, 2009
 

'>' is used to redirect the output to an file in write mode. If it is redirected to a file which already contain some data, then the data will be overwritten.

'>>' redirects the output in append mode. This mode will append the data in existing file.

  Was this answer useful?  Yes

Sabbir

  • Mar 29th, 2016
 

> is used to copy data (output) by overwriting old data.
>> is used to copy data (output) without overwriting old data. Just will be added under old data.

  Was this answer useful?  Yes

Anupam Kumar

  • Nov 2nd, 2016
 

> will redirect the output to file and will overwrite its existing contents. >> will just append.

  Was this answer useful?  Yes

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