24

In linux, how do I do something like

echo 'hello world' > log.txt

but instead of overwriting the contents of log.txt, it appends to the end of of log.txt?

52
echo 'hello world' >> log.txt
6

Try:

>>

In place of:

>
5

In Linux you can also use the useful HERE TAG for multiline append :

cat >> log.txt << EOF
hello word 1
hello word 2
hello word 3
EOF

Linux shell's are more more powerful than windows command prompt! ;)

  • While shell may be more powerful than cmd.exe, I would argue it's not more powerful than powershell. – GregD Aug 14 '10 at 23:13
  • 2
    PowerShell is a Scripting language and for this need to be compared with another scripting language for example Perl then Perl is more more powerful than PowerShell . ;) :D – aleroot Aug 15 '10 at 6:50
  • 2
    Naughty! No language jihads here! – Brent.Longborough Aug 15 '10 at 11:12
3

echo 'hello world' >> log.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.