Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

How can I append the result of a command to a file and redirect stderr to null?

share|improve this question
up vote 7 down vote accepted

You can use >> for appending and 2> /dev/null for redirecting stderr:

mycommand >> outputfile 2> /dev/null

Although I suspect something very similar has been asked already...

share|improve this answer
I knew how to do each individually, but not both together. I couldn't find another question that asked for both. – Benjamin Aug 14 '12 at 19:47

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.