Append an echo to file?

54,641

Solution 1

echo 'hello world' >> log.txt

Solution 2

Try:

>>

In place of:

>

Solution 3

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! ;)

Solution 4

echo 'hello world' >> log.txt

Share:
54,641

Related videos on Youtube

John
Author by

John

We consult and build stuff out of Toronto!

Updated on September 17, 2022

Comments

  • John
    John almost 2 years

    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?

  • GregD
    GregD almost 14 years
    While shell may be more powerful than cmd.exe, I would argue it's not more powerful than powershell.
  • Brent.Longborough
    Brent.Longborough almost 14 years
    Naughty! No language jihads here!