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

后端 未结 6 1932
温柔的废话
温柔的废话 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条回答
  •  迷失自我
    2021-01-14 07:30

    '>>' will let you append data to a file, where '>' will overwrite it. For example:

    # cat test
    test file
    # echo test > test
    # cat test
    test
    # echo file >> test
    # cat test
    test
    file
    

提交回复
热议问题