Home > Net >  Difference between using echo with one greater than sign and two greater than signs
Difference between using echo with one greater than sign and two greater than signs

Time:01-07

I am reading the Kafka documentation. In step 6 of 1.3, there's the following code:

> echo foo> test.txt
> echo bar>> test.txt

I would like to ask what is the difference between using one greater than sign and two greater than signs. Thanks.

CodePudding user response:

  • the former recreate the file on each invocation
  • the later append to file. Create the file the first time if not exists

Check

man bash | less  /'Redirecting Output'
  • Related