What's the difference between using > and >> in shell?

后端 未结 6 2009
温柔的废话
温柔的废话 2021-01-14 07:07

I\'ve seen somewhere that we can use >> in shell. What\'s the difference between using > and >> in shell?

6条回答
  •  猫巷女王i
    2021-01-14 07:46

    Adding more knowledge here.

    We can also use tee command to perform the same:

    cat newfile | tee filename - rewrites/replaces the file with new content in filename
    cat newfile | tee -a filename - appends to the existing content of the file in filename file
    

提交回复
热议问题