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

1 Answer 1


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...

  • I knew how to do each individually, but not both together. I couldn't find another question that asked for both.
    – Benjamin
    Aug 14, 2012 at 19:47

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.