I\'ve seen somewhere that we can use >> in shell. What\'s the difference between using > and >> in shell?
When you use >, as in:
$ echo "this is a test" > output.txt
The > operator will completely overwrite any contents of the file output.txt if it exists. If the file does not exist, it will be created with the contents "this is a test."
This usage:
$ echo "this is a test" >> output.txt
Will add the link "this is a test" to any content in output.txt (called 'appending'). If the file does not exist, it will be created, and the text will be added.