Send stderr & stdout to same file

Send standard error and standard out to the same file

This article may seem odd to those who have read a few of my others. However, this is by far my highest ranking search term. Thus I thought I would write up an simple and explicit explanation.

The following will send the output of ls -la /somewhere to something.txt. This includes standard output and standard error:

# ls -al /somewhere 2>&1 >something.txt

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.