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
Related videos on Youtube
Comments
-
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?
-
Zoredache almost 14 yearsFor full details see the all about I/O redirection in the Advanced Bash-Scripting Guide.
-
Brent.Longborough almost 14 years@Zoredache: Great reference! +1
-
-
GregD almost 14 yearsWhile shell may be more powerful than cmd.exe, I would argue it's not more powerful than powershell.
-
Brent.Longborough almost 14 yearsNaughty! No language jihads here!