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

后端 未结 6 1931
温柔的废话
温柔的废话 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:24

    There is a difference if the file you're redirecting to already exists:

    > truncates (i.e. replaces) an existing file.

    >> appends to the existing file.

提交回复
热议问题