《问》What's is the difference between “>” and “>>” in shell command?

《问》

What's is the difference between “>” and “>>” in shell command?


">"

New Create and Add the Text 'Hello' to the File 'log.txt'

echo "Hello" > log.txt

">>"

  1. This is the same like ">", if the file 'log.txt' exists not.
  2. Olny Append the Text 'Hello' to the End of File 'log.txt', if the file 'log.txt' exists.
ps -aux >> log.txt

Comments

Popular posts from this blog

英语字母a的发音