Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
For full details see the all about I/O redirection in the Advanced Bash-Scripting Guide. – Zoredache Aug 14 '10 at 21:03
@Zoredache: Great reference! +1 – Brent.Longborough Aug 15 '10 at 11:23
up vote 23 down vote accepted
echo 'hello world' >> log.txt
share|improve this answer



In place of:

share|improve this answer

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

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

share|improve this answer
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
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
Naughty! No language jihads here! – Brent.Longborough Aug 15 '10 at 11:12

echo 'hello world' >> log.txt

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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